• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Frustrating NSMenu problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frustrating NSMenu problem


  • Subject: Re: Frustrating NSMenu problem
  • From: j o a r <email@hidden>
  • Date: Tue, 26 Aug 2003 16:30:43 +0200

<speculation>
It could be that you're not allowed to insert new menu items at index 0 and 1 - since they are somewhat reserved by the standard Apple menu and Application menu. Have you tried to insert the item at some other location?

j o a r

On tisdag, augusti 26, 2003, at 04:08 PM, Adam Atlas wrote:

I'm trying to programatically add a new menu to the main menu. I get the menu from a nib, and then in my code I create a wrapper NSMenuItem with the menu as a submenu, and then I try to add it to [NSApp mainMenu].

I get these console messages:
*** Assertion failure in -[NSMenu insertItem:atIndex:], Menus.subproj/NSMenu.m:455
Invalid parameter not satisfying: (index >= 0) && (index <= (_itemArray ? CFArrayGetCount(_itemArray) : 0))

This would seem to imply that there a negative number of menus in the main menu, which there obviously are not.

Should I be doing anything differently in adding a menu to the main menu? What am I doing wrong?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Frustrating NSMenu problem (From: Adam Atlas <email@hidden>)

  • Prev by Date: Re: Apple Help Interface Guidelines
  • Next by Date: Re: Frustrating NSMenu problem
  • Previous by thread: Frustrating NSMenu problem
  • Next by thread: Re: Frustrating NSMenu problem
  • Index(es):
    • Date
    • Thread