NSPopupButton "None" Selection
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