• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cannot Bind Pop Up Button to Array of Dictionaries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot Bind Pop Up Button to Array of Dictionaries


  • Subject: Re: Cannot Bind Pop Up Button to Array of Dictionaries
  • From: Jeff Johnson <email@hidden>
  • Date: Mon, 20 Aug 2007 17:31:56 -0500

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


  • Follow-Ups:
    • Re: Cannot Bind Pop Up Button to Array of Dictionaries
      • From: Colin Cornaby <email@hidden>
References: 
 >Cannot Bind Pop Up Button to Array of Dictionaries (From: Colin Cornaby <email@hidden>)

  • Prev by Date: BOOL problem
  • Next by Date: Re: Cannot Bind Pop Up Button to Array of Dictionaries
  • Previous by thread: Cannot Bind Pop Up Button to Array of Dictionaries
  • Next by thread: Re: Cannot Bind Pop Up Button to Array of Dictionaries
  • Index(es):
    • Date
    • Thread