• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cocoa-dev digest, Vol 2 #4343 - 13 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Menu Mystery
  • Next by Date: Re: Ordered NSDictionary
  • Previous by thread: Re: Menu Mystery
  • Next by thread: Drawing with thread, deadlock
  • Index(es):
    • Date
    • Thread