Avoiding Flicker with OpenGL View when Moving Divider of a Split View

2009-03-21 Thread Chris Suter
Hi all,

I have a split view arranged horizontally with an OpenGL view in the
right pane (surrounded by some other stuff). When I move the divider,
there is a flicker on the right hand side of the OpenGL view. You
don’t get this glitch if you resize the window. It's not a major
issue, just a bit annoying.

Does anyone know what the split view might be doing to cause this
behaviour and how I might workaround it?

I have a simple test project in case anyone is interested.

Regards,

Chris
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


BOOL takeStupidRoad = NO (search app design question)

2009-03-21 Thread David Yamartino
Hi All,

I have a general design question. I'm going through the latest Hillegass and
Kochan programming books for the purpose of writing a simple search app. I
think I've figured out a way to do this, but having no experience in
programming, I have no idea if my approach is good or bad. I'd rather not
take the stupid road if I can avoid it, so I'm hoping someone may be able to
set me straight before I go too far down the road.

So if you're inclined to take a few minutes to consider what I've written
below, I'd appreciate it.

In any case, good luck with your projects,

 David



*APPLICATION DESCRIPTION:*
I have a library of about 1,500 text files, about 93 MB total.

The application window opens with two views: left view shows the hierarchy
of folders/files, and when you click on a file, the text of the file appears
in the right view, where you can read, scroll, etc.

The user inputs a term into the search field, and when the search is
executed, the folders/files on the left view disappear and the view is
repopulated with a new hierarchy showing only the folders/files where the
search term appears. Below each file will be snippets of where the term
appears within the text. Click on a snippet and the right view will show the
entire text of the file zoomed to where the snippet appears.

For example, if the search term is "child education":

*Book X*
   The *child education* conference focused on two age groups: 5-7 years,
and 8-10 years.
 .  .  . because the *child* wasn't receiving the needed attention in
her *education*, her parents decided  .  .  .
 .  .  .  and over the years the *child education* policy was broadened
to include moral education and  .  .  .


*MY APPROACH*:
I can load the text of the 1,500 files into 1500 NSStrings with something
like

stringWithContentsOfFile


 Then I can search the 1,500 NSStrings to locate the position of the search
term within each string, then extract a range (including some words before
and some words after) to make the snippets. Using


 rangeOfString

NSMakeRange

etc.



*QUESTION:*

Would this be a workable approach? Or is it a really stupid idea to have to
load 93 MB of files into 1,500 NSStrings every time the program starts up?
If not this approach, what would be more efficient?


Thanks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Threaded Server using Distributed Objects

2009-03-21 Thread Alan Shouls

Hi,

I am implementing a simple client/server using Distributed Objects. I  
have a single server and a small number of clients. The clients are  
all on the same machine so I communicate using an NSMachPort, and use  
'NSConnection' 'registerName' to register a single connection name on  
which to communicate. It all works fine. My only issue is that the  
server is not threaded - so if if one client asks the server to do  
something time-consuing the the request coming from a different next  
client will have to wait.


So on to my question. I would like to implement a threaded server,  
what I mean is I would like to have a small number of threads so that  
concurrent requests can happen. If one thread is busy then the a free  
thread can take up the challenge. Is it possible to have this on a  
single named connection? If so could someone give me a few pointers or  
a leg-up as to how to go about this.


Best regards

Alan Shouls
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTableView updating checkboxes

2009-03-21 Thread Jo Phils
Hi again Graham,

I have taken some time to work on your suggestions...unfortunately I still 
can't figure out how to uncheck/recheck the checkboxes by clicking on them. :-( 
 I understand what you're telling me about keeping 2 lists and ultimately I 
will get to the point where I have to do something with the items being 
displayed in my table.  But for now I'm still stuck on the checkboxes.  This 
was your last example code with my own variables/comments:

- (void)tableView:(NSTableView*) tv setObjectValue:(id) val 
forTableColumn:(NSTableColumn*) aTableColumn row:(NSInteger) rowIndex
{
id object = [filenames objectAtIndex:rowIndex];  //filenames is my NSArray 
of filenames

if([[aTableColumn identifier] isEqualToString:@"column2"])  //column2 is 
the identifier for my checkbox column
{
BOOL selected = [val boolValue];

// add or remove the object from the selection set

if( selected )

//how can I uncheck the checkbox???  every method i'm trying fails...

[self addToSelection:object];
else

//how can I recheck the checkbox???  every method i'm trying fails...

[self removeFromSelection:object];
}
}

In this method it's so easy:

- (id)tableView:(NSTableView *)aTableView
  objectValueForTableColumn:(NSTableColumn *)aTableColumn
  row:(NSInteger)rowIndex
 
 {
if ([[aTableColumn identifier] isEqualToString:@"column2"])
{
return [NSNumber numberWithInt:NSOnState];  //initializes checkbox 
column with boxes all checked
}
return [filenames objectAtIndex:rowIndex];

There's one more thing...in your first email you said I needed to set something 
in IB and at this point the only thing I have set is the column identifier for 
this checkbox column (column2).  If there is something else I need to set in IB 
I'm not sure where to set it?  I'm not using bindings at this time...

Thank you for your patience Graham.  Ultimately I would have my list of files 
in the first column and this would not change.  Then checkboxes in the second 
column which would start all checked.  Then the user could uncheck/recheck any 
boxes they choose and when it comes to processing time only the files that have 
a checked box will be acted upon.  I might be going about it the wrong way but 
I was just trying to get the checkbox issue working first...thanks again!

Rick




From: Jo Phils 
To: Graham Cox 
Cc: cocoa-dev@lists.apple.com
Sent: Friday, March 20, 2009 11:19:46 PM
Subject: Re: NSTableView updating checkboxes

Thank you again Graham so much for the quick reply.  Yes you're right about 
where I'm headed.  I was just thinking that I could code it that when you click 
on the checkboxes the state would toggle then when I got to the processing step 
I would simply read the state and know how to process each item in my array.  
But I see what you're saying yes at this point I have no set boolean state in 
my array.  I was able to initialize my table view with "checked" boxes by 
returning the ON state but in this method I got stuck because the return is 
void and that's where my problem was.  Ok I will work on your suggestion and I 
really do appreciate all of the help... :-)

I'll let you know,

Rick






From: Graham Cox 
To: Jo Phils 
Cc: cocoa-dev@lists.apple.com
Sent: Friday, March 20, 2009 8:56:23 PM
Subject: Re: NSTableView updating checkboxes


On 20/03/2009, at 8:53 PM, Jo Phils wrote:

> Hi Graham and thank you very much for your reply.  I think I'm still a bit 
> confused I do apologize. :-(  Here's my code so far so you can see...
> 
> - (int)numberOfRowsInTableView:(NSTableView *)aTableView
> {
> return [filenames count];
> }
> 
> 
> - (id)tableView:(NSTableView *)aTableView
>   objectValueForTableColumn:(NSTableColumn *)aTableColumn
>   row:(NSInteger)rowIndex
> 
> {
> if ([[aTableColumn identifier] isEqualToString:@"column2"])
> {
> return [NSNumber numberWithInt:NSOnState];
> }
> return [filenames objectAtIndex:rowIndex];
>
> 
> - (void)tableView:(NSTableView *)aTableView
>   setObjectValue:(id)anObject
>   forTableColumn:(NSTableColumn *)aTableColumn
>   row:(int)rowIndex
> {
> // This is where I'm stuck!
> }
> 
> And in this code I am using my variable which is a list of filenames...
> 
> NSMutableArray *filenames;
> 
> 
> Other than the connections I have in IB I have given this column of 
> checkboxes the Identifier "column2" in IB.  I have not set any other property 
> key like you mentioned and I'm not sure where I would do that?  I'm not using 
> bindings in my case...I was under the impression it was not necessary?  The 
> first 2 methods seem to work fine and the 3rd method is being called but it's 
> just I couldn't figure out the code to change the state of the checkboxes...
> 
> Thank you again so much for your help,
> 


Well, I guess what isn't clear is what the checkboxes actually *mean*. I

Re: Send events to AppleScript

2009-03-21 Thread Тимофей Даньшин


On Mar 21, 2009, at 5:38 AM, has wrote:



On Mar 21, 2009, at 1:06 AM, Тимофей Даньшин wrote:


On Mar 21, 2009, at 3:34 AM, has wrote:


Is it at all possible to have an application send actions to a
particular AppleScript script,


Yes. See NSAppleScript/OSAKit/Carbon OSA APIs. There's a sample  
project in the objc-appscript repository, CallAppleScriptHandler,  
that provides a simple demonstration of calling script handlers  
from ObjC, using appscript's AEM APIs to simplify the process of  
converting Cocoa objects to/from NSAppleEventDescriptors.


Sorry for misleading you, i rather meant "receive events" from  
third party applications.


If you want to run an AppleScript as a standalone application and  
send it events from other applications, save your script in Script  
Editor as a 'stay open' application. As for sending events from  
Cocoa(?) apps to this applet; there's a couple ways you could  
arrange that, but you'd need to provide more details on what the  
setup needs to do if you want specific advice.


Or do you mean that you want to write a Cocoa application that  
forwards some/all incoming events to an embedded AppleScript? In  
that case you want either NSAppleEventManager, or possibly Cocoa  
Scripting, to handle incoming events, and NSAppleScript or OSAKit to  
host the script, and write some glue code to go inbetween.


Well, I'm writing a "translation memory" application, which is a  
program that grabs sentence by sentence from a given text (that needs  
translating), asks the user to translate that sentence and stores the  
translation and the original in a database. If the user comes across  
the same sentence again in the future, he or she will not need to  
translate it again.
I thought i would take the TextEdit app as the text editing part of my  
project, but as I wrote the database management and the search parts,  
it turned out that TextEdit is not capable of correctly interpreting  
word files or RTF's (ie it ignores footnotes, headers/footers and a  
lot of other stuff). That is why I am trying to find out how i can  
communicate with Word or Pages.
As far as what I would want from an AppleScript (if I were to use  
AppleScript) is to be able to receive notifications from Word when,  
for example, the user has hit a certain key combination, to know where  
the insertion point (or selection) is in Word and to receive  
notifications when it moves, to be notified when a user is trying to  
edit something and prevent him/her from doing so if that part of the  
text should not be edited.
Receiving those notifications, that script would just redirect them to  
my application and receive responses to them and redirect them to Word.
In case of scripting bridge, the logic I described for AppleScript  
would be in my application.
But having read what I found and had time to read, I'm not quite sure  
yet I can be notified of the things going on in another application  
(such as Word, for example).






or set that script as a delegate of that application


Depends exactly what you mean by 'delegation'. The OSA API  
provides a whole bunch of arcane selectors and callbacks for two- 
way intra-process integration between application and scripts, but  
whether it's appropriate/how to use it will depend on exactly what  
you're trying to achieve.


By delegation I mean the form of delegation that is present in  
Objective-C, when one can register one's object with another object  
as it's delegate and receive messages from in on certain occasions,  
such as textViewDidChangeSelection:


That's pretty much what the OSA API was designed to do [1] - allow a  
C/C++/ObjC application to load a script and invoke its handlers  
(what AppleScripters call 'attachability'). See Folder actions, Mail  
rule scripts, etc. Satimage Smile, for example, provides a great  
demonstration of just how far you can go with this sort of thing.


HTH

has

[1] With the caveat that the OSA API is somewhat over-complicated,  
under-documented, lame in parts, and only really practical for  
AppleScript despite being theoretically language agnostic.


--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSWorkspace -launchApplication fails to launch, but no error

2009-03-21 Thread Luca C.
Erg,

2009/3/21 Erg Consultant 

> I try to launch an application by passing a full POSIX path to NSWorkspace
> -launchApplication: on 10.3.9 but it fails.
>
> I have built my app using the 10.4 SDK and tried it targeting both 10.3 &
> 10.4 as deployment since I have some newer 10.4 routines which won't work on
> 10.3. I also check each API for NULL before calling it.
>
> When NSWorkspace -launchApplication:runs, it returns YES indicating launch,
> but my app never runs. Double-clicking my app runs it and then it quits
> immediately with no errors. I've checked all my frameworks and weak linking,
> but -launchApplication doesn't work.
>
> My app runs fine on 10.4. and 10.5. But on 10.3 won't launch.
>
> What gives?


  I can't figure out you problem, so my advice is: try using
LSOpenApplication.  Take a look here
<
http://developer.apple.com/DOCUMENTATION/Carbon/Reference/LaunchServicesReference/Reference/reference.html#//apple_ref/c/func/LSOpenApplication
>

The Process Manager's LaunchApplication works well, too.
<
http://developer.apple.com/DOCUMENTATION/Carbon/Reference/Process_Manager/Reference/reference.html#//apple_ref/c/func/LaunchApplication
>

--Luca C.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Is it a "Value" or an "Object" ?

2009-03-21 Thread Jerry Krinock
I've never understood the difference between our use of the words  
"value" and "object".


So, last week I created a little category on NSMutableDictionary which  
constructs nested dictionaries.  See code below for a demo of - 
setValue:forKeyPath:.


Did I name it correctly, or would this method be better named - 
setObject:forKeyPath: ??


Thanks,

Jerry

int main(int argc, const char *argv[]) {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;

NSMutableDictionary* md = [NSMutableDictionary dictionary] ;
[md setValue:@"red"
  forKeyPath:@"meals.lunch.fruit.color"] ;
[md setValue:@"white"
  forKeyPath:@"meals.lunch.cheese.color"] ;
NSLog(@"%@", md) ;

[pool release] ;
return 0 ;
}

*** Console Output ***

[Session started at 2009-03-21 06:30:02 -0700.]
2009-03-21 06:30:02.402 LittleTestTool[89792:10b] {
meals = {
lunch = {
cheese = {
color = white;
};
fruit = {
color = red;
};
};
};
}


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is it a "Value" or an "Object" ?

2009-03-21 Thread Luca C.
Essentially they are the same, but the word "value" fits nicely with KVC.

--Luca C.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is it a "Value" or an "Object" ?

2009-03-21 Thread Jerry Krinock


On 2009 Mar 21, at 06:46, Luca C. wrote:

Essentially they are the same, but the word "value" fits nicely with  
KVC.


Yes, but "setObject" is usually used for dictionaries, although there  
is the variant -setValue:forKey: which handles nil objects, unlike - 
setObject:forKey: which raises an exception.


Is there a method to the madness?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Parameters Bindings

2009-03-21 Thread Richard Somers
In Interface Builder and the Cocoa Bindings Reference documentation,  
each class has its bindings organized by named groups. For example  
Availability Bindings, Content Bindings, Font Bindings, etc.


Many of the classes have a bindings group named Parameters Bindings.  
My question is what is the meaning of Parameters Bindings?


Richard

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is it a "Value" or an "Object" ?

2009-03-21 Thread Keary Suska


On Mar 21, 2009, at 7:57 AM, Jerry Krinock wrote:



On 2009 Mar 21, at 06:46, Luca C. wrote:

Essentially they are the same, but the word "value" fits nicely  
with KVC.


Yes, but "setObject" is usually used for dictionaries, although  
there is the variant -setValue:forKey: which handles nil objects,  
unlike -setObject:forKey: which raises an exception.


Is there a method to the madness?


-setValue:forKey: is not a variant of -setObject:forKey:. - 
setObject:forKey: is the method for setting the object for a specific  
key in an NSMutabelDictionary. -setValue:forKey: is a method declared  
by the NSKeyValueCoding informal protocol implemented in NSObject that  
sets a property value for any NSObject subclass.  There is not likely  
anything more special in the naming use than that.


In fact, the docs for NSMutableDictionary's setValue:forKey: say:  
"This method adds value and key to the receiver using  
setObject:forKey:, unless value is nil in which case the method  
instead attempts to remove key using removeObjectForKey:."


Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Send events to AppleScript

2009-03-21 Thread has

On Mar 21, 2009, at 12:09 PM, Тимофей Даньшин wrote:

Well, I'm writing a "translation memory" application, which is a  
program that grabs sentence by sentence from a given text (that  
needs translating), asks the user to translate that sentence and  
stores the translation and the original in a database. If the user  
comes across the same sentence again in the future, he or she will  
not need to translate it again.
I thought i would take the TextEdit app as the text editing part of  
my project, but as I wrote the database management and the search  
parts, it turned out that TextEdit is not capable of correctly  
interpreting word files or RTF's (ie it ignores footnotes, headers/ 
footers and a lot of other stuff). That is why I am trying to find  
out how i can communicate with Word or Pages.
As far as what I would want from an AppleScript (if I were to use  
AppleScript) is to be able to receive notifications from Word when,  
for example, the user has hit a certain key combination, to know  
where the insertion point (or selection) is in Word and to receive  
notifications when it moves, to be notified when a user is trying to  
edit something and prevent him/her from doing so if that part of the  
text should not be edited.
Receiving those notifications, that script would just redirect them  
to my application and receive responses to them and redirect them to  
Word.


It is rare to find applications that provide notifications, and almost  
unheard of for them to provide notifications of minor events such as  
text edits. You certainly won't get the sort of notifications you  
describe from TextEdit, Word or Pages. ISTR a third-party tool that  
allows you to attach AppleScripts to the GUI objects of another  
application, but that sort of thing is inherently hackish, prone to  
breakage, and liable not to go down too well with increasingly  
security conscious software and users. I suspect your best bet would  
be to poll the application, bearing in mind that might create its own  
issues (e.g. performance/responsiveness).


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Send events to AppleScript

2009-03-21 Thread Тимофей Даньшин
As far as TextEdit is concerned, i thought of taking its source and  
modifying it to my needs, and actually create a single application,  
not a tandem of two or more. I am even beginning to think of taking  
the OppenOffice as the host for my additional functionality, but OO  
doesn't look at all stable. Are there any libraries out there that  
could access all (or at least the most common) elements of .doc, docx  
and RTF documents besides NSDocument? It doesn't really matter if they  
can render page layout correctly, the important thing is that they  
could access and modify those elements.



On Mar 21, 2009, at 7:28 PM, has wrote:


On Mar 21, 2009, at 12:09 PM, Тимофей Даньшин wrote:

Well, I'm writing a "translation memory" application, which is a  
program that grabs sentence by sentence from a given text (that  
needs translating), asks the user to translate that sentence and  
stores the translation and the original in a database. If the user  
comes across the same sentence again in the future, he or she will  
not need to translate it again.
I thought i would take the TextEdit app as the text editing part of  
my project, but as I wrote the database management and the search  
parts, it turned out that TextEdit is not capable of correctly  
interpreting word files or RTF's (ie it ignores footnotes, headers/ 
footers and a lot of other stuff). That is why I am trying to find  
out how i can communicate with Word or Pages.
As far as what I would want from an AppleScript (if I were to use  
AppleScript) is to be able to receive notifications from Word when,  
for example, the user has hit a certain key combination, to know  
where the insertion point (or selection) is in Word and to receive  
notifications when it moves, to be notified when a user is trying  
to edit something and prevent him/her from doing so if that part of  
the text should not be edited.
Receiving those notifications, that script would just redirect them  
to my application and receive responses to them and redirect them  
to Word.


It is rare to find applications that provide notifications, and  
almost unheard of for them to provide notifications of minor events  
such as text edits. You certainly won't get the sort of  
notifications you describe from TextEdit, Word or Pages. ISTR a  
third-party tool that allows you to attach AppleScripts to the GUI  
objects of another application, but that sort of thing is inherently  
hackish, prone to breakage, and liable not to go down too well with  
increasingly security conscious software and users. I suspect your  
best bet would be to poll the application, bearing in mind that  
might create its own issues (e.g. performance/responsiveness).


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSAppleScript - what is going on here?

2009-03-21 Thread Steve Cronin

Folks;

I'm trying to get a string value back from a simple AppleScript in  
Cocoa:


NSDictionary *errorDict= nil;
NSAppleScript *appleScriptObject = [[NSAppleScript alloc]  
initWithSource:theScript];	
NSAppleEventDescriptor *eventDescriptor = [appleScriptObject  
executeAndReturnError: &errorDict];

[appleScriptObject release];
if (([eventDescriptor descriptorType]) && (errorDict==nil)) {
	return [self stringFromAppleEventDescriptor:eventDescriptor];  //my  
own method that checks descriptorType and returns stringValue

} else {
NSLog(@"%@",[errorDict objectForKey:@"NSAppleScriptErrorMessage"]);
return nil;
}

The 'theScript' is a valid script that executes flawlessly in 'Script  
Editor':

tell application "Finder"
try
comment of file ("/Users/steve/" as POSIX file)
on error
return "Error"
end try
end tell

The problem is that the above errors out @ [appleScriptObject  
executeAndReturnError: &errorDict];

The stack is shown below.

What am I overlooking here?
Steve

#0  0x9543c1ab in CFDataGetBytePtr
#1  0x90462218 in XMLDataResolvingXIncludes
#2  0x90464fa8 in OSACopyScriptingDefinition
#3  0x90861531 in -[NSScriptSuiteRegistry loadSuitesFromBundle:]
#4	0x90860ede in -[NSScriptSuiteRegistry  
_loadSuitesForAlreadyLoadedBundles]

#5  0x90860bd4 in -[NSScriptSuiteRegistry init]
#6  0x90860b44 in +[NSScriptSuiteRegistry sharedScriptSuiteRegistry]
#7  0x908608d9 in +[NSScriptSuiteRegistry _loadScriptSuites]
#8  0x907b7f1c in _nsnote_callback
#9  0x954568da in __CFXNotificationPost
#10 0x95456bb3 in _CFXNotificationPostNotification
#11	0x907b5080 in -[NSNotificationCenter  
postNotificationName:object:userInfo:]

#12 0x907be8c8 in -[NSNotificationCenter postNotificationName:object:]
#13	0x90873650 in -[NSAppleEventManager(NSInternal)  
_sendDidFailToDispatchNotification]

#14 0x90873574 in _NSAppleEventManagerPreDispatchHandler
#15 0x952e9648 in aeDispatchAppleEvent
#16 0x952f27be in AESendMessage
#17 0x952f55ab in aeSend
#18 0x957985af in AESend
#19 0x01be917a in AEDefaultSendProc
#20 0x01becdfd in ComponentSend
#21 0x01becfc0 in SendSimpleEventWithReply
#22 0x01bd4c3d in ScanForScriptingAdditions
#23 0x01bd4f07 in ASInitLocal
#24 0x01bd4fa5 in ASDefaultInit
#25 0x01bcca2d in AppleScriptComponent
#26 0x93fdda05 in CallComponentDispatch
#27 0x90456af8 in OSASetActiveProc
#28 0x01be86c4 in AGenericManager::UpdateInstanceProcs
#29 0x01be87e2 in AGenericManager::ComponentFromSubtype
#30 0x01be8915 in AGenericManager::DefaultComponentInstance
#31 0x01be811c in AGenericCall::PreDelegate
#32 0x01be88c9 in AGenericManager::HandleOSACall
#33 0x93fdda05 in CallComponentDispatch
#34 0x904681c3 in OSACompile
#35 0x908a13b8 in -[NSAppleScript compileAndReturnError:]
#36	0x908a16a6 in -[NSAppleScript(NSPrivate)  
_executeWithMode:andReturnError:]

#37 0x908a1461 in -[NSAppleScript executeAndReturnError:]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Threaded Server using Distributed Objects

2009-03-21 Thread Michael Ash
On Sat, Mar 21, 2009 at 6:33 AM, Alan Shouls  wrote:
> Hi,
>
> I am implementing a simple client/server using Distributed Objects. I have a
> single server and a small number of clients. The clients are all on the same
> machine so I communicate using an NSMachPort, and use 'NSConnection'
> 'registerName' to register a single connection name on which to communicate.
> It all works fine. My only issue is that the server is not threaded - so if
> if one client asks the server to do something time-consuing the the request
> coming from a different next client will have to wait.
>
> So on to my question. I would like to implement a threaded server, what I
> mean is I would like to have a small number of threads so that concurrent
> requests can happen. If one thread is busy then the a free thread can take
> up the challenge. Is it possible to have this on a single named connection?
> If so could someone give me a few pointers or a leg-up as to how to go about
> this.

I've never done it, but it looks to me like you can make multiple
calls to the -addRunLoop: method to get the NSConnection to use
multiple threads for responding to requests.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


MacRoman -> UTF8

2009-03-21 Thread Ben Lachman
My software uses UTF8 almost exclusively.  However, for some odd  
reason, arguments passed from a perl cgi script to one of my command  
line helper apps are encoded as MacRoman.  That's not a problem since  
I can just use [NSString stringWithCString:argv[i]  
encoding:NSMacOSRomanStringEncoding].  However it seems that one can't  
convert MacRoman -> UTF8 after you get it into a NSString.  Is there a  
way to make this conversion in code so that once I read the arguments  
I can just deal with them like all the rest of the strings in my app?


Another viable solution would be a way to make the arguments passed in  
UTF8 since they are when they're handled by the script anyway--they  
must be getting changed somewhere in the bowels of the exec/system  
commands.


Thanks,
->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email: blach...@mac.com
twitter: @benlachman
mobile: 740.590.0009



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MacRoman -> UTF8

2009-03-21 Thread Clark Cox
On Sat, Mar 21, 2009 at 2:31 PM, Ben Lachman  wrote:
> My software uses UTF8 almost exclusively.  However, for some odd reason,
> arguments passed from a perl cgi script to one of my command line helper
> apps are encoded as MacRoman.

Where is the CGI script getting the text, and what encoding does it
start off in?

> That's not a problem since I can just use
> [NSString stringWithCString:argv[i] encoding:NSMacOSRomanStringEncoding].
>  However it seems that one can't convert MacRoman -> UTF8 after you get it
> into a NSString.

I don't know what you mean by "convert MacRoman -> UTF8 after you get
it into a NSString". After you get text into an NSString it is, by
definition, no longer MacRoman.

> Is there a way to make this conversion in code so that
> once I read the arguments I can just deal with them like all the rest of the
> strings in my app?
>
> Another viable solution would be a way to make the arguments passed in UTF8
> since they are when they're handled by the script anyway--they must be
> getting changed somewhere in the bowels of the exec/system commands.

-- 
Clark S. Cox III
clarkc...@gmail.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSLevelIndicator Bindings Crash

2009-03-21 Thread Walker Argendeli
I'm using Core Data, and I have an entity; we'll call it "Item".  It  
has an attribute called "priority".  In the xib, I have an  
NSLevelIndicator and NSStepper.  I have a NSTableView full of  
"Items".  Depending on which item is selected in the table view, I  
want the level indicator and stepper to display the right values, and  
for me to be able to set them to a certain value for each item.  There  
are 2 problems: If I bind the value of either one to  
Item.arrangedObjects.priority, the app throws an exception, whereas if  
I bind to Item.selection.priority, the controls don't set each item's  
priority individually.  What should I bind to?
Secondly, an NSLevelIndicator wants a float for its value, whereas an  
NSStepper wants a double for its value.  Which should I set it to in  
the core data model?


Thanks,
- Walker Argendeli

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


What is -launchApplication:'s "name of the application"

2009-03-21 Thread Jerry Krinock

From NSWorkspace documentation,
   - (BOOL)launchApplication:(NSString *)appName

  Parameters > appName > The name of the application to open.

Well, applications can have several names, so I believe this is  
ambiguous.


My guess is that, in this context, "name" means the CFBundleIdentifier  
value in the application's Info.plist.  Did I guess correctly?


Thanks to anyone who knows!

Jerry

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is -launchApplication:'s "name of the application"

2009-03-21 Thread Jerry Krinock
I was just thinking about the Discussion in the documentation some  
more, and it implies that the name would be the name of the .app  
package in the filesystem.  So, that might be the answer, but then,  
this is going to break if the user changes the name of the package.   
Seems odd.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Why isn't NSString's caseInsensitiveCompare working correctly?

2009-03-21 Thread Wesley Spikes
Odds are, it's a bug that is based entirely in my code, but it's bugging me
now, and I've hit a road block mentally. Any help provided would be greatly
appreciated.

Please excuse the crypticness of this message, but I'm only able to disclose
the parts of the code in question.

The basic overview of what's happening in the code is [classInst
findIndexOfFilename:inData:] is being called, with the filename being passed
in from a directory enumeration. A manual browsing through the data makes it
look like all aspects of it appear like it should work.

If anything further needs to be known, just let me know, I'll likely be able
to provide.

At the moment, I'm pretty sure it should work by the looks of it. What's
really bothersome about it to me is that the output of the first error shows
that the entry at 10:28:17.401 is the only entry that is outputted by
findIndexOfFilename:inData:, and none of the subsequent entries are
presented as having been checked. *scratches head*

 First failed output record in the XCode console
[Session started at 2009-03-21 10:28:17 -0700.]
2009-03-21 10:28:17.400 IX2[52319:10b] "Contents"
2009-03-21 10:28:17.401 IX2[52319:10b] "Contents" != "Contents"
2009-03-21 10:28:17.407 IX2[52319:10b] Hmm, it appears that "Contents" is
not in passed data pointer. pname=<>/Contents

 The code to find the index -- before this is called, the caller is
currently calling NSLog(@"%@", fn);
- (int) findIndexOfFilename:(NSString*)fn
 inData:(S_KH_DATA*)data
{
  int ctr   = 0;
  NSString *s;

  // this would indicate a failure in our build process
  assert( data[0].filename != NULL );

  do {
s = [NSString stringWithCString:data[ctr].filename
encoding:NSUTF8StringEncoding];
if( [fn length] != [s length] ) continue; // don't go and do a full
compare if diff lens
if( [fn caseInsensitiveCompare:s] ) break;
NSLog(@"%@ != %@", fn, s);
  } while( data[++ctr].filename != NULL );

  if( data[ctr].filename != NULL )
return ctr;
  return -1;
}

 The structure that is the data[x]
typedef struct _S_KH_DATA
  {
uint8_t   fs_type;  // 1 is directory, 2 is plain
file, 3 is executable file, 0 is unset/ignore
char *filename; // filename is the name of the
filesystem
uint8_t   hash[SHA512_DIGEST_LENGTH];   // sha2-512
  } S_KH_DATA;

 The data being passed (first entries only, abbreviated)
S_KH_DATA kh_data [] = {
  { KHD_TYPE_DIRECTORY, "", 0 },
  { KHD_TYPE_DIRECTORY, "Contents", 0 },
  { KHD_TYPE_DIRECTORY, "Contents/MacOS", 0 },
  { KHD_TYPE_PLAIN_FILE, "Contents/Info.plist", { 0x82, ..., 0xe3, } },
  ...
  { 0, NULL, 0 },
};


--
Wesley Spikes
wesley.spi...@gmail.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


nstableview **very** basic question

2009-03-21 Thread Michael
I've been struggling with this for a few days...so time to ask, if I  
may.
I am trying to emulate Scott Anguish's multiplication table in his  
book. I cannot get tableview to show columns of constant width.


I have looked at the guides of Apple, tried to understand all the  
nuances of tableview, scrollview, headers etc, looked at numerous  
tutorials on NSTableview, (most a little dated),  discerned  that  
perhaps I should be looking at NSTableColumn, and thought I had found  
the answer doing this.


-(void) awakeFromNib
{
NSLog(@"awakeFromNib: setting \"sizeToFit\"");
[tv sizeToFit];

}

where tv is declared as:  "IBOutlet NSTableView *tv;"

As far as I can tell, the outlet is set correctly, NSLog is called at  
the appropriate time.


What I get when I use the above code is the first couple of columns  
varying in size, then the next "n" columns equally space.


If I have missed something in the documentation, I would appreciate a  
pointer, but somehow, I cannot believe that it is this difficult to  
do, but perhaps I am doing something that will become a lot easier  
further into Hillegas tutorial?


Thanks in advance.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Why isn't NSString's caseInsensitiveCompare working correctly?

2009-03-21 Thread Julien Jalon
   if( [fn caseInsensitiveCompare:s] ) break;
   NSLog(@"%@ != %@", fn, s);


compare methods return NSOrderedSame (==0) if the strings are the same so
your test here seems incorrect.

On Sat, Mar 21, 2009 at 7:26 PM, Wesley Spikes wrote:

> Odds are, it's a bug that is based entirely in my code, but it's bugging me
> now, and I've hit a road block mentally. Any help provided would be greatly
> appreciated.
>
> Please excuse the crypticness of this message, but I'm only able to
> disclose
> the parts of the code in question.
>
> The basic overview of what's happening in the code is [classInst
> findIndexOfFilename:inData:] is being called, with the filename being
> passed
> in from a directory enumeration. A manual browsing through the data makes
> it
> look like all aspects of it appear like it should work.
>
> If anything further needs to be known, just let me know, I'll likely be
> able
> to provide.
>
> At the moment, I'm pretty sure it should work by the looks of it. What's
> really bothersome about it to me is that the output of the first error
> shows
> that the entry at 10:28:17.401 is the only entry that is outputted by
> findIndexOfFilename:inData:, and none of the subsequent entries are
> presented as having been checked. *scratches head*
>
>  First failed output record in the XCode console
> [Session started at 2009-03-21 10:28:17 -0700.]
> 2009-03-21 10:28:17.400 IX2[52319:10b] "Contents"
> 2009-03-21 10:28:17.401 IX2[52319:10b] "Contents" != "Contents"
> 2009-03-21 10:28:17.407 IX2[52319:10b] Hmm, it appears that "Contents" is
> not in passed data pointer. pname=<>/Contents
>
>  The code to find the index -- before this is called, the caller is
> currently calling NSLog(@"%@", fn);
> - (int) findIndexOfFilename:(NSString*)fn
> inData:(S_KH_DATA*)data
> {
>  int ctr   = 0;
>  NSString *s;
>
>  // this would indicate a failure in our build process
>  assert( data[0].filename != NULL );
>
>  do {
>s = [NSString stringWithCString:data[ctr].filename
> encoding:NSUTF8StringEncoding];
>if( [fn length] != [s length] ) continue; // don't go and do a full
> compare if diff lens
>if( [fn caseInsensitiveCompare:s] ) break;
>NSLog(@"%@ != %@", fn, s);
>  } while( data[++ctr].filename != NULL );
>
>  if( data[ctr].filename != NULL )
>return ctr;
>  return -1;
> }
>
>  The structure that is the data[x]
> typedef struct _S_KH_DATA
>  {
>uint8_t   fs_type;  // 1 is directory, 2 is plain
> file, 3 is executable file, 0 is unset/ignore
>char *filename; // filename is the name of the
> filesystem
>uint8_t   hash[SHA512_DIGEST_LENGTH];   // sha2-512
>  } S_KH_DATA;
>
>  The data being passed (first entries only, abbreviated)
> S_KH_DATA kh_data [] = {
>  { KHD_TYPE_DIRECTORY, "", 0 },
>  { KHD_TYPE_DIRECTORY, "Contents", 0 },
>  { KHD_TYPE_DIRECTORY, "Contents/MacOS", 0 },
>  { KHD_TYPE_PLAIN_FILE, "Contents/Info.plist", { 0x82, ..., 0xe3, } },
>  ...
>  { 0, NULL, 0 },
> };
>
>
> --
> Wesley Spikes
> wesley.spi...@gmail.com
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/jjalon%40gmail.com
>
> This email sent to jja...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MacRoman -> UTF8

2009-03-21 Thread Ben Lachman

On Mar 21, 2009, at 5:38 PM, Clark Cox wrote:


On Sat, Mar 21, 2009 at 2:31 PM, Ben Lachman  wrote:
My software uses UTF8 almost exclusively.  However, for some odd  
reason,
arguments passed from a perl cgi script to one of my command line  
helper

apps are encoded as MacRoman.


Where is the CGI script getting the text, and what encoding does it
start off in?


UTF-8.  See the last bit of my post,  seemingly they're being  
converted somewhere in the internals of the exec command.





 That's not a problem since I can just use
[NSString stringWithCString:argv[i]  
encoding:NSMacOSRomanStringEncoding].
 However it seems that one can't convert MacRoman -> UTF8 after you  
get it

into a NSString.


I don't know what you mean by "convert MacRoman -> UTF8 after you get
it into a NSString". After you get text into an NSString it is, by
definition, no longer MacRoman.


Thats what I thought.  However, say I start by reading "bén" as I  
noted above, then I call printf("%s", [myStringReadFromMacRoman  
UTF8String]) and it prints "bÈn".  However if I call printf("%s",  
[myStringReadFromMacRoman  
cStringUsingEncoding:NSMacOSRomanStringEncoding]) is prints out  
correctly.  Now I'm thoroughly confused and am not sure what's  
happening.  Any more thoughts?


->Ben




 Is there a way to make this conversion in code so that
once I read the arguments I can just deal with them like all the  
rest of the

strings in my app?

Another viable solution would be a way to make the arguments passed  
in UTF8
since they are when they're handled by the script anyway--they must  
be

getting changed somewhere in the bowels of the exec/system commands.


--
Clark S. Cox III
clarkc...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MacRoman -> UTF8

2009-03-21 Thread Stephen J. Butler
On Sat, Mar 21, 2009 at 5:50 PM, Ben Lachman  wrote:
> Thats what I thought.  However, say I start by reading "bén" as I noted
> above, then I call printf("%s", [myStringReadFromMacRoman UTF8String]) and
> it prints "bÈn".  However if I call printf("%s", [myStringReadFromMacRoman
> cStringUsingEncoding:NSMacOSRomanStringEncoding]) is prints out correctly.
>  Now I'm thoroughly confused and am not sure what's happening.  Any more
> thoughts?

What does printf( "LANG = %s\n", genenv( "LANG" ) ); say? For example,
on 10.5.6 with Terminal set to UTF-8 I get:

LANG = en_US.UTF-8

If I change it to MacRoman or Latin-1 then I get just

LANG = en_US

If you need to change your terminal settings, it's "Preferences... "
-> Settings -> (choose your default) -> Advanced -> Character
encoding.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Kevin Ross
Hi everyone, I'm auditing my app and the both the "leaks" command line  
tool and the Instruments tool are both reporting that I have NSString  
leaks.  All of the leaks are coming from code similar to the following:


NSFont *ageStarTextFont = [NSFont fontWithName:@"Arial Bold"  
size:KRLesserDimensionOfRect(transientDrawingRect)/3];


I'm guessing that the string in question is the @"Arial Bold" since it  
that is the only string on that line, but from what I understand a  
string created like that doesn't require a -release message.  Could  
these be false positives generated by the leaks tool, or is there  
something that I'm missing?


Thanks for any pointers!


Kevin Ross

Twenty-Four Mountains
Mac Feng Shui Software
ke...@twentyfourmountains.com
twentyfourmountains.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Kevin Ross
Whoops, I thought that I'd also mention that I've run the code though  
the clang static analyzer and it doesn't report that there are any  
bugs.  I'm also happy to post more code if it will help.


Thanks again!

Kevin


On Mar 21, 2009, at 4:36 PM, Kevin Ross wrote:

Hi everyone, I'm auditing my app and the both the "leaks" command  
line tool and the Instruments tool are both reporting that I have  
NSString leaks.  All of the leaks are coming from code similar to  
the following:


NSFont *ageStarTextFont = [NSFont fontWithName:@"Arial Bold"  
size:KRLesserDimensionOfRect(transientDrawingRect)/3];


I'm guessing that the string in question is the @"Arial Bold" since  
it that is the only string on that line, but from what I understand  
a string created like that doesn't require a -release message.   
Could these be false positives generated by the leaks tool, or is  
there something that I'm missing?


Thanks for any pointers!


Kevin Ross

Twenty-Four Mountains
Mac Feng Shui Software
ke...@twentyfourmountains.com
twentyfourmountains.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/faderanger%40sbcglobal.net

This email sent to faderan...@sbcglobal.net



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread mm w
be careful with clang, sometimes is missing point,
your problem is coming not from this @"Arial Bold",
give the complete stack and explain what is the condition of the leak

False/positive: I have an extensive use of perf tools since years and
I didn't see that since a while
the leak can be deeper than your app ===  give the complete stack-trace

On Sat, Mar 21, 2009 at 4:43 PM, Kevin Ross  wrote:
> Whoops, I thought that I'd also mention that I've run the code though the
> clang static analyzer and it doesn't report that there are any bugs.  I'm
> also happy to post more code if it will help.
>
> Thanks again!
>
> Kevin
>
>
> On Mar 21, 2009, at 4:36 PM, Kevin Ross wrote:
>
>> Hi everyone, I'm auditing my app and the both the "leaks" command line
>> tool and the Instruments tool are both reporting that I have NSString leaks.
>>  All of the leaks are coming from code similar to the following:
>>
>> NSFont *ageStarTextFont = [NSFont fontWithName:@"Arial Bold"
>> size:KRLesserDimensionOfRect(transientDrawingRect)/3];
>>
>> I'm guessing that the string in question is the @"Arial Bold" since it
>> that is the only string on that line, but from what I understand a string
>> created like that doesn't require a -release message.  Could these be false
>> positives generated by the leaks tool, or is there something that I'm
>> missing?
>>
>> Thanks for any pointers!
>>
>>
>> Kevin Ross
>>
>> Twenty-Four Mountains
>> Mac Feng Shui Software
>> ke...@twentyfourmountains.com
>> twentyfourmountains.com
>>
>>
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> http://lists.apple.com/mailman/options/cocoa-dev/faderanger%40sbcglobal.net
>>
>> This email sent to faderan...@sbcglobal.net
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/openspecies%40gmail.com
>
> This email sent to openspec...@gmail.com
>



-- 
-mmw
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Kevin Ross

Ummm  Here is some truncated output from the command line leaks:

Leak: 0x15fd4970  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4990  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd49c0  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd49e0  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4a00  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4a20  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4a40  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4a60  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4a80  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
Leak: 0x15fd4ac0  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.


Is that what you are asking about?



Kevin



On Mar 21, 2009, at 4:51 PM, mm w wrote:


be careful with clang, sometimes is missing point,
your problem is coming not from this @"Arial Bold",
give the complete stack and explain what is the condition of the leak

False/positive: I have an extensive use of perf tools since years and
I didn't see that since a while
the leak can be deeper than your app ===  give the complete stack- 
trace


On Sat, Mar 21, 2009 at 4:43 PM, Kevin Ross  
 wrote:
Whoops, I thought that I'd also mention that I've run the code  
though the
clang static analyzer and it doesn't report that there are any  
bugs.  I'm

also happy to post more code if it will help.

Thanks again!

Kevin


On Mar 21, 2009, at 4:36 PM, Kevin Ross wrote:

Hi everyone, I'm auditing my app and the both the "leaks" command  
line
tool and the Instruments tool are both reporting that I have  
NSString leaks.

 All of the leaks are coming from code similar to the following:

NSFont *ageStarTextFont = [NSFont fontWithName:@"Arial Bold"
size:KRLesserDimensionOfRect(transientDrawingRect)/3];

I'm guessing that the string in question is the @"Arial Bold"  
since it
that is the only string on that line, but from what I understand a  
string
created like that doesn't require a -release message.  Could these  
be false
positives generated by the leaks tool, or is there something that  
I'm

missing?

Thanks for any pointers!


Kevin Ross

Twenty-Four Mountains
Mac Feng Shui Software
ke...@twentyfourmountains.com
twentyfourmountains.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

http://lists.apple.com/mailman/options/cocoa-dev/faderanger%40sbcglobal.net

This email sent to faderan...@sbcglobal.net



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/openspecies%40gmail.com

This email sent to openspec...@gmail.com





--
-mmw



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests 

Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Kevin Ross

Here's the block of surrounding code:

NSFont *ageStarTextFont = [NSFont fontWithName:@"Arial Bold"

  
size:KRLesserDimensionOfRect(transientDrawingRect)/3];
	NSMutableDictionary *txtAttributes = [NSMutableDictionary  
dictionaryWithObject:ageStarTextFont



forKey:NSFontAttributeName];

/* Add a white outline attribute for 
readability */
//	NSColor *textStrokeColor = [[NSColor whiteColor]  
colorWithAlphaComponent:0.7];

[txtAttributes setObject:[NSNumber 
numberWithFloat:-6.0]
  
forKey:NSStrokeWidthAttributeName];
[txtAttributes setObject:textStrokeColor
  
forKey:NSStrokeColorAttributeName];

/* Draw the string for the age star in 
the grid */
NSString *ageStarInfo = 
[portent.ageStar stringValue];
[ageStarInfo drawCenteredInRect: 
centerBox
 
withAttributes: txtAttributes];


Any ideas?

Thanks,

Kevin


On Mar 21, 2009, at 4:51 PM, mm w wrote:


be careful with clang, sometimes is missing point,
your problem is coming not from this @"Arial Bold",
give the complete stack and explain what is the condition of the leak

False/positive: I have an extensive use of perf tools since years and
I didn't see that since a while
the leak can be deeper than your app ===  give the complete stack- 
trace


On Sat, Mar 21, 2009 at 4:43 PM, Kevin Ross  
 wrote:
Whoops, I thought that I'd also mention that I've run the code  
though the
clang static analyzer and it doesn't report that there are any  
bugs.  I'm

also happy to post more code if it will help.

Thanks again!

Kevin


On Mar 21, 2009, at 4:36 PM, Kevin Ross wrote:

Hi everyone, I'm auditing my app and the both the "leaks" command  
line
tool and the Instruments tool are both reporting that I have  
NSString leaks.

 All of the leaks are coming from code similar to the following:

NSFont *ageStarTextFont = [NSFont fontWithName:@"Arial Bold"
size:KRLesserDimensionOfRect(transientDrawingRect)/3];

I'm guessing that the string in question is the @"Arial Bold"  
since it
that is the only string on that line, but from what I understand a  
string
created like that doesn't require a -release message.  Could these  
be false
positives generated by the leaks tool, or is there something that  
I'm

missing?

Thanks for any pointers!


Kevin Ross

Twenty-Four Mountains
Mac Feng Shui Software
ke...@twentyfourmountains.com
twentyfourmountains.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

http://lists.apple.com/mailman/options/cocoa-dev/faderanger%40sbcglobal.net

This email sent to faderan...@sbcglobal.net



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/openspecies%40gmail.com

This email sent to openspec...@gmail.com





--
-mmw


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Bill Bumgarner

On Mar 21, 2009, at 4:56 PM, Kevin Ross wrote:
Leak: 0x15fd4ac0  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.


Is that what you are asking about?


Almost.   Now, set the MallocStackLoggingNoCompact environment  
variable in the process you are testing (you can do so via the  
Executables inspector in Xcode or 'set env  
MallocStackLoggingNoCompact=1' in gdb) and use 'leaks' again.


b.bum

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Kevin Ross

Thanks Bill,  here's the tail of the same output:

	Call stack: [thread 0xa00e5720]: | start | main | NSApplicationMain |  
-[NSApplication run] | -[NSApplication sendEvent:] | -[NSApplication  
_handleKeyEquivalent:] | -[NSMenu performKeyEquivalent:] | - 
[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] | - 
[NSMenu performActionForItemAtIndex:] | -[NSApplication  
sendAction:to:from:] | -[NSButtonCell performClick:] | -[NSControl  
drawCell:] | -[NSWindow displayIfNeeded] | -[NSView displayIfNeeded] |  
-[NSView  
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] |  
-[NSThemeFrame  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | - 
[NSView _drawRect:clip:] | -[KRMiniGridStarChartView drawRect:] | - 
[KRStarChartMO drawPortentsInRect:circleStyle:] | +[NSFont  
fontWithName:size:] | __NSFontFactoryWithName | +[__NSFontTypefaceInfo  
typefaceInfoForPostscriptName:] |  
TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*) const |  
TDescriptorSourceImp::CopyFontDescriptorPerPostscriptName(__CFString  
const*, unsigned int) const | ATSFontFindFromPostScriptName |  
_eATSFontFindFromPostScriptName | _eATSSendFontQuery |  
CFStringCreateWithCString | __CFStringCreateImmutableFunnel3 |  
_CFRuntimeCreateInstance | malloc_zone_malloc
Leak: 0x15fb82d0  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
	Call stack: [thread 0xa00e5720]: | start | main | NSApplicationMain |  
-[NSApplication run] | -[NSApplication sendEvent:] | -[NSApplication  
_handleKeyEquivalent:] | -[NSMenu performKeyEquivalent:] | - 
[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] | - 
[NSMenu performActionForItemAtIndex:] | -[NSApplication  
sendAction:to:from:] | -[NSButtonCell performClick:] | -[NSControl  
drawCell:] | -[NSWindow displayIfNeeded] | -[NSView displayIfNeeded] |  
-[NSView  
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] |  
-[NSThemeFrame  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] | -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | - 
[NSView _drawRect:clip:] | -[KRMiniGridStarChartView drawRect:] | - 
[KRStarChartMO drawPortentsInRect:circleStyle:] | +[NSFont  
fontWithName:size:] | __NSFontFactoryWithName | +[__NSFontTypefaceInfo  
typefaceInfoForPostscriptName:] |  
TDescriptor::CreateMatchingDescriptor(__CFSet const*) const |  
TDescriptor::GetBaseFont() const | TDescriptor::InitBaseFont() |  
TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*) const |  
TDescriptorSourceImp::CopyFontDescriptorPerPostscriptName(__CFString  
const*, unsigned int) const | ATSFontFindFromPostScriptName |  
_eATSFontFindFromPostScriptName | _eATSSendFontQuery |  
CFStringCreateWithCString | __CFStringCreateImmutableFunnel3 |  
_CFRuntimeCreateInstance | malloc_zone_malloc
Leak: 0x15fb8320  size=32	instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation	

0xa00664a0 0x0100078c 0x5354410e 0x65755120 .d...ATS Que
0x50207972 0x0074726f 0x 0x ry Port.
	Call stack: [thread 0xa00e5720]: | start | main | NSApplicationMain |  
-[NSApplication run] | -[NSApplication sendEvent:] | -[NSApplication  
_handleKeyEquivalent:] | -[NSMenu performKeyEquivalent:] | - 
[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] | - 
[NSMenu performActionForItemAtIndex:] | -[NSApplication  
sendAction:to:from:] | -[NSButtonCell performClick:] | -[NSControl  
drawCell:] | -[NSWindow displayIfNeeded] | -[NSView displayIfNeeded] |  
-[NSView  
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisi

Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread Bill Bumgarner

On Mar 21, 2009, at 5:09 PM, Kevin Ross wrote:
KRStarChartMO drawPortentsInRect:circleStyle:] | +[NSFont  
fontWithName:size:] | __NSFontFactoryWithName | + 
[__NSFontTypefaceInfo typefaceInfoForPostscriptName:] |  
TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*) const  
| TDescriptorSourceImp::CopyFontDescriptorPerPostscriptName 
(__CFString const*, unsigned int) const |  
ATSFontFindFromPostScriptName | _eATSFontFindFromPostScriptName |  
_eATSSendFontQuery | CFStringCreateWithCString |  
__CFStringCreateImmutableFunnel3 | _CFRuntimeCreateInstance |  
malloc_zone_malloc


That looks an awful lot like a leak in the ATS subsystem.

File a bug via http://bugreport.apple.com/ and send me the #, please.

b.bum

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is -launchApplication:'s "name of the application"

2009-03-21 Thread Michael Ash
On Sat, Mar 21, 2009 at 6:17 PM, Jerry Krinock  wrote:
> From NSWorkspace documentation,
>   - (BOOL)launchApplication:(NSString *)appName
>
>      Parameters > appName > The name of the application to open.
>
> Well, applications can have several names, so I believe this is ambiguous.
>
> My guess is that, in this context, "name" means the CFBundleIdentifier value
> in the application's Info.plist.  Did I guess correctly?

You're correct that it's ambiguous, not only because applications can
have several names, but because several applications can have the same
name.

The answer here is not to use this method at all. The bundle ID is the
proper way to uniquely identify an application, use a method which
takes that instead.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MacRoman -> UTF8

2009-03-21 Thread Michael Ash
On Sat, Mar 21, 2009 at 6:50 PM, Ben Lachman  wrote:
>>>  That's not a problem since I can just use
>>> [NSString stringWithCString:argv[i] encoding:NSMacOSRomanStringEncoding].
>>>  However it seems that one can't convert MacRoman -> UTF8 after you get
>>> it
>>> into a NSString.
>>
>> I don't know what you mean by "convert MacRoman -> UTF8 after you get
>> it into a NSString". After you get text into an NSString it is, by
>> definition, no longer MacRoman.
>
> Thats what I thought.  However, say I start by reading "bén" as I noted
> above, then I call printf("%s", [myStringReadFromMacRoman UTF8String]) and
> it prints "bÈn".  However if I call printf("%s", [myStringReadFromMacRoman
> cStringUsingEncoding:NSMacOSRomanStringEncoding]) is prints out correctly.
>  Now I'm thoroughly confused and am not sure what's happening.  Any more
> thoughts?

All this means is that whatever is displaying your printfs expects
MacRoman encoding rather than UTF-8 encoding. Since we don't know
what's displaying them, it's hard to say anything further.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread mm w
if you want I have a similar one with LibTiff and imageIO (10.5.6)
make a simple project with a 2 NSButton with a Tiff Image

Cheers!

On Sat, Mar 21, 2009 at 5:33 PM, Bill Bumgarner  wrote:
> On Mar 21, 2009, at 5:09 PM, Kevin Ross wrote:
>>
>> KRStarChartMO drawPortentsInRect:circleStyle:] | +[NSFont
>> fontWithName:size:] | __NSFontFactoryWithName | +[__NSFontTypefaceInfo
>> typefaceInfoForPostscriptName:] |
>> TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*) const |
>> TDescriptorSourceImp::CopyFontDescriptorPerPostscriptName(__CFString const*,
>> unsigned int) const | ATSFontFindFromPostScriptName |
>> _eATSFontFindFromPostScriptName | _eATSSendFontQuery |
>> CFStringCreateWithCString | __CFStringCreateImmutableFunnel3 |
>> _CFRuntimeCreateInstance | malloc_zone_malloc
>
> That looks an awful lot like a leak in the ATS subsystem.
>
> File a bug via http://bugreport.apple.com/ and send me the #, please.
>
> b.bum
>
>



-- 
-mmw
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString and Leaks Instrument, False Positives?

2009-03-21 Thread mm w
sorry for the extra characters that you got my iphone auto-provides me words...



On Sat, Mar 21, 2009 at 5:51 PM, mm w  wrote:
> if you want I have a similar one with LibTiff and imageIO (10.5.6)
> make a simple project with a 2 NSButton with a Tiff Image
>
> Cheers!
>
> On Sat, Mar 21, 2009 at 5:33 PM, Bill Bumgarner  wrote:
>> On Mar 21, 2009, at 5:09 PM, Kevin Ross wrote:
>>>
>>> KRStarChartMO drawPortentsInRect:circleStyle:] | +[NSFont
>>> fontWithName:size:] | __NSFontFactoryWithName | +[__NSFontTypefaceInfo
>>> typefaceInfoForPostscriptName:] |
>>> TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*) const |
>>> TDescriptorSourceImp::CopyFontDescriptorPerPostscriptName(__CFString const*,
>>> unsigned int) const | ATSFontFindFromPostScriptName |
>>> _eATSFontFindFromPostScriptName | _eATSSendFontQuery |
>>> CFStringCreateWithCString | __CFStringCreateImmutableFunnel3 |
>>> _CFRuntimeCreateInstance | malloc_zone_malloc
>>
>> That looks an awful lot like a leak in the ATS subsystem.
>>
>> File a bug via http://bugreport.apple.com/ and send me the #, please.
>>
>> b.bum
>>
>>
>
>
>
> --
> -mmw
>



-- 
-mmw
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: MacRoman -> UTF8

2009-03-21 Thread Clark Cox
On Sat, Mar 21, 2009 at 3:50 PM, Ben Lachman  wrote:
> On Mar 21, 2009, at 5:38 PM, Clark Cox wrote:
>
>> On Sat, Mar 21, 2009 at 2:31 PM, Ben Lachman  wrote:
>>>
>>> My software uses UTF8 almost exclusively.  However, for some odd reason,
>>> arguments passed from a perl cgi script to one of my command line helper
>>> apps are encoded as MacRoman.
>>
>> Where is the CGI script getting the text, and what encoding does it
>> start off in?
>
> UTF-8.  See the last bit of my post,  seemingly they're being converted
> somewhere in the internals of the exec command.

Trust me, there's nothing inside of exec that would do this.

>>>  That's not a problem since I can just use
>>> [NSString stringWithCString:argv[i] encoding:NSMacOSRomanStringEncoding].
>>>  However it seems that one can't convert MacRoman -> UTF8 after you get
>>> it
>>> into a NSString.
>>
>> I don't know what you mean by "convert MacRoman -> UTF8 after you get
>> it into a NSString". After you get text into an NSString it is, by
>> definition, no longer MacRoman.
>
> Thats what I thought.  However, say I start by reading "bén" as I noted
> above, then I call printf("%s", [myStringReadFromMacRoman UTF8String]) and
> it prints "bÈn".  However if I call printf("%s", [myStringReadFromMacRoman
> cStringUsingEncoding:NSMacOSRomanStringEncoding]) is prints out correctly.
>  Now I'm thoroughly confused and am not sure what's happening.  Any more
> thoughts?

What is the encoding of your terminal set to?

-- 
Clark S. Cox III
clarkc...@gmail.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSAppleScript - what is going on here?

2009-03-21 Thread Jerry Krinock


On 2009 Mar 21, at 10:38, Steve Cronin wrote:


What am I overlooking here?



#0  0x9543c1ab in CFDataGetBytePtr
#1  0x90462218 in XMLDataResolvingXIncludes
#2  0x90464fa8 in OSACopyScriptingDefinition
#3  0x90861531 in -[NSScriptSuiteRegistry loadSuitesFromBundle:]
#4	0x90860ede in -[NSScriptSuiteRegistry  
_loadSuitesForAlreadyLoadedBundles]

#5  0x90860bd4 in -[NSScriptSuiteRegistry init]


Looks like maybe it's having trouble parsing your sdef file.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: nstableview **very** basic question

2009-03-21 Thread Jerry Krinock


On 2009 Mar 21, at 14:27, Michael wrote:


I cannot get tableview to show columns of constant width.



[tv sizeToFit];


What I get when I use the above code is the first couple of columns  
varying in size, then the next "n" columns equally space.


If I have missed something in the documentation,


Maybe you have.  The documentation for -[NSTableView sizeToFit] says:
   "All columns are resized to the same size, up to a column's  
maximum size."


H.  What are your columns' maximum sizes?  These can be set in  
Interface Builder, but to find out for sure, try something like this:


for (NSTableColumn* tc in [tv tableColumns]) {
   NSLog(@"maxWidth = %f", [tc maxWidth]) ;
}


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How can main thread be blocked in mach_msg_trap?

2009-03-21 Thread Jerry Krinock


NSLogs tell me that, when one of my secondary threads executes a  
performSelectorOnMainThread::: at a certain point, the requested  
method never begins.  So I conclude that the main thread ^is^ blocked.


But if I "Pause" the debugger at this point and examine the call stack  
for "Thread-1", I see:


#0  0x9540b1c6 in mach_msg_trap
#1  0x954129bc in mach_msg
#2  0x9495f0ae in CFRunLoopRunSpecific
#3  0x9495fcd8 in CFRunLoopRunInMode
#4  0x929ced75 in -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
#5  0x929dae94 in -[NSRunLoop(NSRunLoop) run]
#6  0x2a3f in main at Worker-Main.m:112

I always thought that mach_msg_trap means that a thread is sitting at  
the top of a run loop waiting for an input source, such as  
performSelectorOnMainThread:::, to wake it.  Therefore it is ^not^  
blocked.


My understanding thus ends in a paradox.  How can this be explained?

(Notice that this is a background agent in which I have explicitly  
invoked -[NSRunLoop run])


Thank you,

Jerry Krinock


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Explicit release when using garbage collection with circular references

2009-03-21 Thread David
Is there any issue issuing explicit release when using garbage
collection with Leopard and Obj-c 2.0?

I've become aware that I have lots of memory not being freed within my
application. I presume this is because its a tree structure with
parent child pointers between the objects. If I drop the last
reference to the tree, I presume the tree does not get garbage
collected because each object has circular pointers between them, ie
parent has references to children and each child has a reference to
its parent. In this case, it seem that the appropriate course of
action would be to call a specific method to forcibly release each
node in the tree.
Is this the proper approach?
Should garbage collection somehow work anyway?

Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Explicit release when using garbage collection with circular references

2009-03-21 Thread Bill Bumgarner

On Mar 21, 2009, at 9:11 PM, David wrote:

Is there any issue issuing explicit release when using garbage
collection with Leopard and Obj-c 2.0?


-release is ignored entirely.

CFRelease() work as it always does, and balances CFRetain() nicely.

But that isn't the issue.


I've become aware that I have lots of memory not being freed within my
application. I presume this is because its a tree structure with
parent child pointers between the objects. If I drop the last
reference to the tree, I presume the tree does not get garbage
collected because each object has circular pointers between them, ie
parent has references to children and each child has a reference to
its parent. In this case, it seem that the appropriate course of
action would be to call a specific method to forcibly release each
node in the tree.
Is this the proper approach?
Should garbage collection somehow work anyway?


That would be an incorrect presumption.  The garbage collector handles  
complexly connected, but not rooted, graphs just fine. Your sub-graphs  
-- trees -- of objects that are no longer referenced by your rooted  
object graphs should be reaped without a problem.


So, something else is going on.

Have you used 'info gc-roots' to see what is causing the items within  
your tree to stick around?


b.bum

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How can main thread be blocked in mach_msg_trap?

2009-03-21 Thread Eric Schlegel


On Mar 21, 2009, at 8:54 PM, Jerry Krinock wrote:



NSLogs tell me that, when one of my secondary threads executes a  
performSelectorOnMainThread::: at a certain point, the requested  
method never begins.  So I conclude that the main thread ^is^ blocked.


But if I "Pause" the debugger at this point and examine the call  
stack for "Thread-1", I see:


#0  0x9540b1c6 in mach_msg_trap
#1  0x954129bc in mach_msg
#2  0x9495f0ae in CFRunLoopRunSpecific
#3  0x9495fcd8 in CFRunLoopRunInMode
#4  0x929ced75 in -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
#5  0x929dae94 in -[NSRunLoop(NSRunLoop) run]
#6  0x2a3f in main at Worker-Main.m:112

I always thought that mach_msg_trap means that a thread is sitting  
at the top of a run loop waiting for an input source, such as  
performSelectorOnMainThread:::, to wake it.  Therefore it is ^not^  
blocked.


My understanding thus ends in a paradox.  How can this be explained?


I seem to recall that performSelectorOnMainThread: might not actually  
wake the main thread. You might have to wake the main thread  
explicitly, for example by creating and posting a fake NSEvent. This  
would accord with your description of the problem occuring in a bg- 
only app that's not receiving normal user input events.


-eric

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com