I'm creating an object with:
NSMenu *appMainMenu = [[NSMenu alloc] initWithTitle:@"MyApp"];
(Ignore the fact I'm creating this menu programmatically and not using a Nib File. I understand the disadvantages of doing so)
The menu appears correctly in the menubar.
However, when I try to call any instance method such as:
[appMainMenu addItemWithTitle:@"MyTitle" action:@selector(myaction:) keyEquivalent:@"t"];
XCode offer some completions, but none appear to come from NSMenu.
I've tried both
#import <AppKit/AppKit.h> and #import <AppKit/NSMenu.h>
The instance methods are certainly there in NSMenu.h, and as I said, it installs my menu. It just doesn't install the menu item. That plus the lack of completions makes me think that my appMainMenu is not being recognized as a NSMenu object, even though it's obviously valid.
What obvious thing am I missing?