title: How to create Cocoa app main menu application programatically
body: <p>I am creating simple Cocoa application from scratch, just to learn the process.</p>
  <p>However I am not able to create Application Menu. I have this code:</p>
  <pre><code>- (void)applicationDidFinishLaunching:(NSNotification *)notification {
    [self createMenu];
  }
  
  -(void)createMenu
  {
     NSMenu* myMenu = [[NSMenu alloc] init];
     NSString* quitTitle = @&quot;Quit&quot;;
     NSMenuItem* quitMenuItem = [[NSMenuItem alloc] initWithTitle:quitTitle
                                                   action:@selector(terminate:)
                                            keyEquivalent:@&quot;q&quot;];
     [myMenu addItem:quitMenuItem];
     [NSApp setMainMenu:myMenu];
   }
  </code></pre>
  <p>However after launching the app when I click on the App name in the menu bar nothing happens</p>
  <p>What am I missing please?</p>
  <p>Thanks in advance</p>