Re: NSComboBox bound to NSMutableArray of NSMutableDictionary with NSArrayController?
Re: NSComboBox bound to NSMutableArray of NSMutableDictionary with NSArrayController?
- Subject: Re: NSComboBox bound to NSMutableArray of NSMutableDictionary with NSArrayController?
- From: Laurent Daudelin <email@hidden>
- Date: Thu, 7 Oct 2010 15:42:37 -0700
On Oct 7, 2010, at 15:30, Quincey Morris wrote:
> On Oct 7, 2010, at 15:14, Laurent Daudelin wrote:
>
>> I just want to have a pre-determined list of items but I'd like the user to have the ability to add new items. That's why I chose the NSComboBox but I see one problem with it. If the user adds one item, that's only a string and it won't be a dictionary. I might have to use a datasource instead.
>
> You could certainly bind the combo box's "value" binding to a string property in your data model, whose setter created a new dictionary when necessary. I'm not certain, though, how you'd be sure the user typed a new "Name" for the purpose of creating a new dictionary or just mistyped an existing one.
>
> Alternatively, use a pop up menu instead, with a "New XXX..." entry as well as the existing names. That's a more traditional way of doing it, which has the benefit of discoverability for the creation function (unlike the combo box solution).
Yeah, perhaps that's what I will do. Thanks, Quincey.
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
Logiciels Nemesys Software email@hidden
_______________________________________________
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