• 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 "None" Selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPopupButton "None" Selection


  • Subject: NSPopupButton "None" Selection
  • From: Keith Duncan <email@hidden>
  • Date: Tue, 3 Jul 2007 20:58:19 +0100

I have a popup button whose content and content values are bound to an array controller. My model objects have two relevant string properties 'name' and 'uid'. The content of the popup binding is simply bound to the array controller's arrangedObjects and the contentValues is bound to the name key path. This all works fine. The UI presents the name and the backend works with the uid.

What I'm looking to build onto this is a way to provide the user a localized @"None" option in addition to the dynamic content of the array controller. I need to do this in such a way that it can be picked up in the controllers selection.

The only working solution I've come up with is to subclass the model to statically return @"None" for -(NSString *)name and nil for - (NSString *)uid, then put a single instance of this subclass at the beginning of the array using the indexed accessors. OK it works but it seems more like a work-around. Does anyone have a cleaner solution?

- Keith
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSPopupButton "None" Selection
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: image file on disk - use in HTTP request
  • Next by Date: Screen Saver Problems
  • Previous by thread: Re: NSOutlineView validateDrop Flips Values
  • Next by thread: Re: NSPopupButton "None" Selection
  • Index(es):
    • Date
    • Thread