• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOpenPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Weird NSUnarchiver "more data than room " exception
  • Next by Date: Re: Elapsed time of a thread
  • Previous by thread: Re: NSOpenPanel
  • Next by thread: NSPrintOperation accessory view question
  • Index(es):
    • Date
    • Thread