Re: NSMenu itemAtIndex: problem
Re: NSMenu itemAtIndex: problem
- Subject: Re: NSMenu itemAtIndex: problem
- From: "Tony" <email@hidden>
- Date: Mon, 11 Nov 2002 00:49:01 -0500 (EST)
you were right.
That function does raise an exception.
Guess i was using the wrong function.
Thanks.
--- On Sun 11/10, Andreas Mayer wrote:
From: Andreas Mayer [mailto: email@hidden]
To: email@hidden
Date: Mon, 11 Nov 2002 05:55:23 +0100
Subject: Re: NSMenu itemAtIndex: problem
>
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 )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.
The most personalized portal on the Web!
_______________________________________________
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.