Re: cocoa-dev digest, Vol 2 #4343 - 13 msgs
Re: cocoa-dev digest, Vol 2 #4343 - 13 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #4343 - 13 msgs
- From: Jerry LeVan <email@hidden>
- Date: Fri, 11 Jun 2004 00:50:32 -0400
Doh,
The list is getting shorter, while the index is getting larger...
This works...
-(IBAction) updateScriptsMenu:(id)sender
{
int i;
NSMenu * zMenu = [sender menu];
int menuSize = [ zMenu numberOfItems];
NSLog(@"menusize: %d",menuSize);
for( i=3 ; i< menuSize ; i++) {
NSLog(@"I:%d Item:%@",i, [[zMenu itemAtIndex:3] title]);
[zMenu removeItemAtIndex:3];
}
}
On Jun 11, 2004, at 12:12 AM, email@hidden wrote:
I have a dynamically built menu (with submenus) that reflects
the contents of a file directory hierarchy.
I want to, at the users request, refresh the menu. I am trying
to do this by first deleting the menu and then calling the
rebuild routine.
Regrettably there is something that I do not understand. The
tear down code fails for reasons that are not clear to me...
Here is the destroy code:
-(IBAction) updateScriptsMenu:(id)sender
{
int i;
NSMenu * zMenu = [sender menu];
int menuSize = [ zMenu numberOfItems];
NSLog(@"menusize: %d",menuSize);
for( i=3 ; i< menuSize ; i++) {
NSLog(@"I:%d Item:%@",i, [[zMenu itemAtIndex:i] title]);
[zMenu removeItemAtIndex:i];
}
}
_______________________________________________
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.