Re: Cannot Bind Pop Up Button to Array of Dictionaries
Re: Cannot Bind Pop Up Button to Array of Dictionaries
- Subject: Re: Cannot Bind Pop Up Button to Array of Dictionaries
- From: Colin Cornaby <email@hidden>
- Date: Mon, 20 Aug 2007 15:34:12 -0700
Yep, that did it. Silly mistake on my end.
Thanks,
Colin
On Aug 20, 2007, at 3:31 PM, Jeff Johnson wrote:
Colin,
It looks to me like you have your dictionary objects and keys
reversed. The array with @"humanName" should be the keys.
-Jeff
On Aug 20, 2007, at 5:08 PM, Colin Cornaby wrote:
I'm having trouble with something that should be a mindless task.
I'm trying to bind a pop up menu to an array of dictionaries. The
dictionaries contain two values, a human readable name, and a more
internal data representation friendly name. I create the array of
dictionaries like so:
[self setDatabases:[NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjects:[NSArray
arrayWithObjects:@"humanName", @"sqlName", nil]
forKeys:[NSArray arrayWithObjects:@"Darth Vader, Lord of the
Sith", @"darth.vader", nil]],
[NSDictionary dictionaryWithObjects:
[NSArrayarrayWithObjects:@"humanName", @"sqlName", nil]
forKeys:[NSArray arrayWithObjects:@"Yoda, Jedi Master",
@"yoda.greenface", nil]],
nil]];
(Some constants changed to protect the innocent..)
I vend this array to other objects via an accessor named databases.
I have an array controller's content array bound to my vending
objects databases accessor.
Finally I have my pop up button. It's content is bound to my array
controller's arranged objects, and it's content values are bound to
the arranged objects, with the key as "humanName".
The weird thing is that while my pop up button shows the correct
number of rows, they're all blank. I plug in a placeholder for all
the situations where a value could be nil and so on, and all the
rows still show up as blank. Nothing looks funny with my memory
management...
Anyone have any ideas why this could be going on?
Thanks,
Colin
_______________________________________________
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