Re: NSMenu itemAtIndex: problem
Re: NSMenu itemAtIndex: problem
- Subject: Re: NSMenu itemAtIndex: problem
- From: Tony Cate <email@hidden>
- Date: Sun, 10 Nov 2002 22:51:08 -0600
On Sun, 10 Nov 2002 23:22:46 -0500 (EST), Tony wrote:
>
while ([myMenu itemAtIndex: 0])
>
{
>
[myMenu removeItemAtIndex: 0];
>
}
>
>
But this results in a infinite loop.
WARNING! WARNING! The following is a wild hairy guess. (I'm still
kinda new.)
Because the while statement isn't really testing anything. itematIndex
returns a menu item. You have to test to see if anything is there. Try:
while([myMenu itemAtIndex:0] != nil)
{
........
}
_______________________________________________
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.