NSMenu *menu, *infoMenu;
menu = AUTORELEASE([NSMenu new]);
infoMenu = AUTORELEASE ([NSMenu new]);
[infoMenu addItemWithTitle: @"Info Panel..."
action: @selector (orderFrontStandardInfoPanel:)
keyEquivalent: @""];
[infoMenu addItemWithTitle: @"Help..."
action: @selector (orderFrontHelpPanel:)
keyEquivalent: @"?"];
NSMenuItem *menuItem;
menuItem = [menu addItemWithTitle: @"Info..." action: NULL
keyEquivalent: @""];
[menu setSubmenu: infoMenu forItem: menuItem] ;
[menu addItemWithTitle: @"Quit" action: @selector (terminate:)
keyEquivalent: @"q"];
[self setMenu: menu] ;
[self setHorizontal: YES] ;
At run the app, I see the menu, but when I do a clic in this the app
crash. If I delete the last two lines, and write [NSApp setMainMenu:
menu], the app work fine. In Mac dev center there isn't information
about this class (in fact is deprecated). Any suggestion?