title: How do you create and attach MainMenu.xib manually in Cocoa Application?
body: <p>I already started working on a few small Cocoa Application. It works just fine, but now I want to create my own MainMenu (not using the default MainMenu.xib created by XCode).</p>
  
  <p>But I got a few obstacle. First, I add two XIB and its corresponding NSWindowController. The idea is the first xib will call the other xib file. But as these two xib file is a Window and with its NSWindowController, I got quite confuse on how to add the MainMenu. I create another XIB file with name MainMenu.xib, and in the startup XIB file, I do this :</p>
  
  <pre><code> - (void)windowDidLoad
     {
       [super windowDidLoad];
       mainMenu = [[NSMenu alloc] initWithWindowNibName:@"MainMenu"];
       [self setMainMenu:mainMenu];  
     }
  </code></pre>
  
  <p>but it's not working. The first startup XIB didn't display the MainMenu at all (so I can't quit the application).</p>
  
  <p>As for the MainMenu.xib itself, I already connect it with the startup XIB (using NSOBject that dragged into left pane of the XIB Designer).</p>
  
  <p>What is the proper way of creating main menu for multi XIB like this?
  I hope I state my problem correctly, as I quite new in this Cocoa things :)</p>
  
  <p>Thanks in advance! </p>