title: cocoa NSMenu add NSMenuItem in position
body: <p>I'm trying to create an NSMenu in my application. I succesfully create the menu, with some fixed items, and now I have to add some items programmatically. I succeed also in that, but it adds the item at the bottom of the others. There's a way to put this programmatically created items between fixed items? Here's my code:</p>
  
  <p>.h:</p>
  
  <pre><code>@interface AppController : NSObject {
  
      IBOutlet NSMenu *statusMenu;
      NSStatusItem *statusItem;
  }
  </code></pre>
  
  <p>.m</p>
  
  <pre><code>  [statusMenu setAutoenablesItems:NO];
  
      statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
      [statusItem setMenu:statusMenu];
  
      NSImage *statusImage = [[NSImage alloc] initWithContentsOfFile:@"Icon.icns"];
      [statusItem setImage:statusImage];
      [statusItem setTitle:@"Multibox"];
      [statusItem setHighlightMode:YES];
  
      NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@"Carlo | 0000000000" 
                                                    action:@selector(fooClicked:) keyEquivalent:@""]; 
      [item setTarget:self];
      [statusMenu addItem:item];
  </code></pre>