NSMenu and NSMenuItem help
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