Re: NSComboBox problem in 10.6.2
Re: NSComboBox problem in 10.6.2
- Subject: Re: NSComboBox problem in 10.6.2
- From: Jim Correia <email@hidden>
- Date: Fri, 19 Mar 2010 08:31:31 -0400
On Mar 18, 2010, at 3:38 PM, H. Miersch wrote:
> when i try to launch the app from within xcode, the console shows the following:
>
> 2010-03-18 19:26:28.515 StoX[63999:a0f] An uncaught exception was raised
> 2010-03-18 19:26:28.534 StoX[63999:a0f] *** -[NSCFArray objectAtIndex:]: index (-1 (or possibly larger)) beyond bounds (5)
> 2010-03-18 19:26:28.596 StoX[63999:a0f] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (-1 (or possibly larger)) beyond bounds (5)'
> *** Call stack at first throw:
> (
> 0 CoreFoundation 0x00007fff87ddb444 __exceptionPreprocess + 180
> 1 libobjc.A.dylib 0x00007fff800470f3 objc_exception_throw + 45
> 2 CoreFoundation 0x00007fff87ddb267 +[NSException raise:format:arguments:] + 103
> 3 CoreFoundation 0x00007fff87ddb1f4 +[NSException raise:format:] + 148
> 4 Foundation 0x00007fff8798e080 _NSArrayRaiseBoundException + 122
> 5 Foundation 0x00007fff878f0b81 -[NSCFArray objectAtIndex:] + 75
> 6 AppKit 0x00007fff80ba2012 -[NSComboBoxCell selectItemAtIndex:] + 191
> 7 StoX 0x0000000100001693 -[AppController awakeFromNib] + 50
This is the interesting frame
> 8 CoreFoundation 0x00007fff87d8a82d -[NSSet makeObjectsPerformSelector:] + 205
> 9 AppKit 0x00007fff8086c913 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1445
> 10 AppKit 0x00007fff8086ab49 loadNib + 226
> 11 AppKit 0x00007fff8086a059 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248
> 12 AppKit 0x00007fff80869e91 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326
> 13 AppKit 0x00007fff80867413 NSApplicationMain + 279
> 14 StoX 0x00000001000015a8 start + 52
> )
> terminate called after throwing an instance of 'NSException'
>
> i've checked that i'm using the types that the docs say i should be using, but i don't understand why index comes back as -1.
>
> am i doing something wrong? should I be doing something i'm not doing? is the documentation wrong? is there a bug somewhere?
Look at your code in awakeFromNib. It appears you are ending -selectItemAtIndex: to the combo box, and the index is out of bounds.
- Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden