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: Quincey Morris <email@hidden>
- Date: Thu, 7 Oct 2010 13:05:32 -0700
On Oct 7, 2010, at 12:32, Laurent Daudelin wrote:
> My NSMutableDictionary keys are Name and Service. I bound the NSArrayController to my NSMutableArray ivar. I then set my NSComboBox content to NSArrayController.arrangedObjects and NSComboBox content values to NSArrayController.arrangedObjects.Name but the NSComboBox doesn't display anything and I don't get any error in the console.
>
> So, can I provide an array of NSMutableDictionary or does it have to be an array of NSString?
What does "doesn't display anything" mean? Are you saying that the text field portion of the combo box has nothing in it, or that the popup list isn't populated with anything, or both?
You need to find out whether the problem is in NSComboBox, the bindings, NSArrayController or KVO compliance. The easiest way to solve this is to break it down. Try (temporarily) creating a table view that display the strings in NSArrayController.arrangedObjects.Name, for example. Or try binding your array controller to a simple array of strings, leaving contentValues unbound initially.
Incidentally, I just want to check that you're aware that a combo box isn't going to function like a menu? It's not going to provide a way to *choose* one of the dictionaries from your array.
_______________________________________________
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