Shouldn't it be:
{id: 1, name: @"Front"}
{id: 2, name: @"Sports"}
{id: 3, name: @"Opinion"}
{id: 4, name: @"Living"}
{id: 4, name: @"Calendar"}

note the '@'

Chaitanya

On 13-Oct-08, at 2:29 PM, Ken Tozier wrote:

Hi

I have a popup in a table cell I'm trying to bind, programatically, to a simple array of NSDictionaries and want to display a single field from each dictionary as the menu text. What I'm getting instead is the entire dictionary serialized as a menu item. Here's how I'm doing the binding

Here's an example of the array of dictionaries I'm trying to bind to:

{id: 1, name: "Front"}
{id: 2, name: "Sports"}
{id: 3, name: "Opinion"}
{id: 4, name: "Living"}
{id: 4, name: "Calendar"}

Here;s what I want to appear in the menu:

Front
Sports
Opinion
Living
Calendar

Here's what I'm actually seeing in the menu:

{id: 1, name: "Front"}
{id: 2, name: "Sports"}
{id: 3, name: "Opinion"}
{id: 4, name: "Living"}
{id: 4, name: "Calendar"}


Here's how I'm setting up the bindings:

masterCell              = [[NSPopUpButtonCell alloc] init];
[masterCell setBordered: NO];
[masterCell setBezeled: NO];

masterColumn            = [[NSTableColumn alloc] initWithIdentifier: @"master"];
[masterColumn setDataCell: masterCell];
[masterColumn bind: @"content" toObject: self withKeyPath: @"properties.masters" options: nil]; [masterColumn bind: @"contentValues" toObject: self withKeyPath: @"properties.masters.name" options: nil];

// NOTE: I'm really not sure how to specify the selection as the value resides in another object [masterColumn bind: @"selectedValue" toObject: self withKeyPath: @"pages.master" options: nil];
        
I read the docs here: http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSPopUpButtonCell.html#/ /apple_ref/doc/uid/NSPopUpButtonCell-DontLinkElementID_801 but after hours of futzing, I'm still not able to get it working

And as best as I can figure, it should work, so why am I getting these serialized dictionaries?

Thanks for any help
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/chaitanya%40expersis.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to