Re: NSOpenPanel
Re: NSOpenPanel
- Subject: Re: NSOpenPanel
- From: "M. Uli Kusterer" <email@hidden>
- Date: Fri, 3 Oct 2003 19:59:47 +0200
At 1:52 Uhr +1000 04.10.2003, Malcolm Sharman wrote:
I don't entirely understand why the NSLog() line of code is crashing..
I think this is in the FAQ:
http://www.alastairs-place.net/cocoa/faq.txt
result = [panel runModalForDirectory:NSHomeDirectory() file:nil
types:nil];
if (result == NSOKButton) {
NSArray *files = [panel filenames];
NSLog(@"*** %@ items in array ***", [files count]);
...
}
I'm just confused as to why accessing the count method of NSArray would
crash when I just initalised it. Any ideas?
%@ is the identifier used for printing objects. [files count] returns
an unsigned int. You want %i or %d.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >NSOpenPanel (From: Malcolm Sharman <email@hidden>) |