• 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
NSPopUpButton + NSArrayController: always adds the 'No Value' item at the bottom of other values.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPopUpButton + NSArrayController: always adds the 'No Value' item at the bottom of other values.


  • Subject: NSPopUpButton + NSArrayController: always adds the 'No Value' item at the bottom of other values.
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Wed, 29 Mar 2006 15:29:02 -0800


I have a NSPopUpButton bound to a NSArrayController.

The NSArrayController is dependent on a NSTreeController for content.

Every time I change the content of the NSArrayController, the bound NSPopUpBottom displays the 'No Value' item that is at the bottom of the list.

1) If I try to REMOVE this item via action code, I get the following:
*** Assertion failure in -[NSMenu itemAtIndex:], Menus.subproj/ NSMenu.m:713
Invalid parameter not satisfying: (index >= 0) && (index < (_itemArray ? CFArrayGetCount((CFArrayRef)_itemArray) : 0))



2) When I select an item (higher in the NSPopUpButton list), the 'No Value' item at the end, is gone.


3) I can place a ' ' - blank for a null placeholder value via the content of the binding, but that only shows a blank item, the other items are above this one.

Question: Is there a way to AVOID the extra 'No Value' item of a bound NSPopUpButton?

That is, there appears to always be a nil value attached to the list after each re-populating the NSPopUpButton from the bound NSArrayController.
Is it possible to avoid the extra nil?


Regards,

Ric.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: "freed object" error
  • Next by Date: Rendering RSS feeds like Safari
  • Previous by thread: "freed object" error
  • Next by thread: Rendering RSS feeds like Safari
  • Index(es):
    • Date
    • Thread