Apple's docs say:
All of an application’s menus in the menu bar are owned by one NSMenu instance that’s created by the application when it starts up. You can retrieve this main menu with the NSApplication method mainMenu.
I have the following is in my delegate class to obtain the app's menu:
- (void)applicationDidFinishLaunching:(NSNotification *)notification{
NSMenu *mainMenu=[[NSApplication sharedApplication] mainMenu];
}
why is mainMenu
nil? Am I calling it at the wrong time? Putting [[NSApplication sharedApplication] mainMenu]
in my view controller's loadView
also returns nil.
All I want to do is add items to the application menu bar.