Re: NSMenu menu items on the fly problem
Re: NSMenu menu items on the fly problem
- Subject: Re: NSMenu menu items on the fly problem
- From: glenn andreas <email@hidden>
- Date: Thu, 14 Jul 2005 16:46:21 -0500
On Jul 14, 2005, at 3:40 PM, Luc Vandal wrote:
Am I doing something wrong???
I'd see what is going on in the debugger, but at the very, the
following has a problem:
for(int i=0;i<nSubCount;i++)
{
[subMenu removeItemAtIndex:i];
}
This should be [subMenu removeItemAtIndex: 0]
(since as you increase i, the number of items in the submenu are
decremented, and eventually, i ends up greater than the number of
items left in the submenu, which should raise an exception). The
first time through, since there are no elements (or even if there was
1 element) it would work fine...
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden