• 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
NSMenu and NSMenuItem help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMenu and NSMenuItem help


  • Subject: NSMenu and NSMenuItem help
  • From: Jeff LaMarche <email@hidden>
  • Date: Wed, 9 Jan 2002 23:53:32 -0800

I'm trying to get a handle to one of the menu items in my application's menu. I'm having two problems, first of all, when I get a sub-menu using any of the itemAt... methods, it gives an uncaught exception when I then send an itemAt message to the submenu, something like this:

NSMenu *appMenu;
NSMenuItem *item;

appMenu = [[NSApp mainMenu] itemAtIndex:0];
item = (NSMenu *)([appMenu itemAtIndex:1]); <----- Exception raised: *** -[NSMenuItem itemAtIndex:]: selector not recognized


The second problem I have is that when I do an NSLog on the appMenu, it shows me the apple menu and all the other menus EXCEPT for the application menu. Is there some special way of getting the application menu??

Thanks in advance!
Jeff


  • Follow-Ups:
    • Re: NSMenu and NSMenuItem help
      • From: Stéphane Sudre <email@hidden>
    • Re: NSMenu and NSMenuItem help
      • From: Thomas Lachand-Robert <email@hidden>
  • Prev by Date: Re: Database
  • Next by Date: Re: Database
  • Previous by thread: Re: Need help setting font of NSTextView
  • Next by thread: Re: NSMenu and NSMenuItem help
  • Index(es):
    • Date
    • Thread