Re: NSPopupButton "None" Selection
Re: NSPopupButton "None" Selection
- Subject: Re: NSPopupButton "None" Selection
- From: Keary Suska <email@hidden>
- Date: Wed, 04 Jul 2007 09:36:51 -0600
- Thread-topic: NSPopupButton "None" Selection
on 7/3/07 1:58 PM, email@hidden purportedly said:
> 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?
I don't know how the rest of your app works, but it would be cleaner to use
your regular model object. What you are doing now sounds like a hack that
may come back to bite you. I don't know where the array is getting its
content from, but by creating the "none" object when the content is
generated or by storing it with the saved data.
In my own practice, if I have a "null" selection for a data item, I always
have a standard object that represents that selection. That way I minimize
code needed to handle the "null" condition.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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