• 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: "Alastair J.Houghton" <email@hidden>
  • Date: Tue, 26 Aug 2003 15:30:45 +0100

On Tuesday, August 26, 2003, at 03:08 pm, Adam Atlas wrote:

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.

On the contrary, it implies that you are passing an invalid (i.e. out of range) index value into -insertItem:atIndex:. Try NSLog()ing your index value and the result of -numberOfItems just before the call to -insertItem:atIndex: and see whether what you are passing makes sense (in a menu with N items, the indices 0...N are valid).

Kind regards,

Alastair.
_______________________________________________
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: Frustrating NSMenu problem
  • Next by Date: Setting font to WebView
  • Previous by thread: Re: Frustrating NSMenu problem
  • Next by thread: Re: Frustrating NSMenu problem
  • Index(es):
    • Date
    • Thread