On Sep 28, 2008, at 4:20 PM, Felipe Monteiro de Carvalho wrote:

Hello,

I am having a problem with toolbars. I have created a delegate class
for my toolbar, but when I added the
toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: method it
crashes:

Exception:  EXC_BREAKPOINT (0x0006)
Code[0]:    0x00000002
Code[1]:    0x00000000


Thread 0 Crashed:
0   com.apple.Foundation        0x9282a45f _NSRaiseError + 227
1 com.apple.Foundation 0x92851247 +[NSException raise:format:] + 57 2 com.apple.Foundation 0x9285108c _NSArrayRaiseInsertNilException + 75 3 com.apple.Foundation 0x927f47fc -[NSCFArray insertObject:atIndex:] + 125
4   com.apple.AppKit            0x933c5279 -[NSToolbar
_forceInsertItem:atIndex:] + 364
5   com.apple.AppKit            0x933c4df2 -[NSToolbar
_insertNewItemWithItemIdentifier:atIndex:notifyDelegate:notifyView:notifyFamilyAndUpdateDefaults :]
+ 152

It looks like your delegate method is returning nil. You can't return nil from itemForItemIdentifier:.


I suppose that the bool used in the routine will be mapped to a long,
is that it? What is the adequate type encoding for a bool in
Objective-C? The docs says nothing about this.

BOOLs are signed char.

-Peter

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to