Re: NSMenu itemAtIndex: problem
Re: NSMenu itemAtIndex: problem
- Subject: Re: NSMenu itemAtIndex: problem
- From: Andreas Mayer <email@hidden>
- Date: Mon, 11 Nov 2002 05:55:23 +0100
Am Montag, 11.11.02 um 05:22 Uhr schrieb Tony:
What exactly does NSMenu's itemAtIndex: return when there is no item
at that index?
I thought it would raise an exception. At least that's what the
documentation says:
----
itemAtIndex:
- (id <NSMenuItem>)itemAtIndex:(int)index
Returns the menu item at location index of the receiver. It raises an
exception if index is out of bounds.
----
while ([myMenu itemAtIndex: 0])
{
[myMenu removeItemAtIndex: 0];
}
Why not
while ([myMenu numberOfItems])
bye. Andreas.
_______________________________________________
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.