Binding NSDictionary in NSArray into table view cell
Binding NSDictionary in NSArray into table view cell
- Subject: Binding NSDictionary in NSArray into table view cell
- From: Chris Paveglio <email@hidden>
- Date: Tue, 16 Apr 2013 10:26:07 -0700 (PDT)
I'm having trouble with bindings. I have an mutable array which contains 2 or more mutable dictionaries. I want to display the dictionary items in an NSTableView using NSTableCellView (the one where I can do custom layout in the cell with multiple text boxes/image boxes etc). And the dictionary items must be editable. The user can not add or delete rows to the table/array.
I've tried a lot of things that don't work and searching for examples or leads for this. One source said it was not really doable (an old thread on this list).
I've added an NSArrayController to the xib. Set it's contentArray binding to my array. Then I selected a text box in my table cell where one of the dictionary values would go. I set it's binding to BindTo:arrayController; controllerKey:arrangedObjects; modelKeyPath:{key for the object in dictionary}. I also checked on continuously updates values and validates immediately.
I've tried multiple variations on setting the modelKeyPath, using string notation @"Keyname" and without. I've used tables before with direct column binding to objects, but not like this compound array/dictionary setup and I must be missing something with key selecting a dictionary item.
I tried using an NSDictionaryController but that doesn't seem to do the right thing for me either. I think I've tries 999 variations and I can't find the only 1 that works.
It appears, just by doing some NSLog, that the array controller is getting the values set, but just won't translate to showing in the cell view.
Any other tips on special forms of input that the Model Key Path can take?
Any good suggestions, examples, or reference to a tutorial on this?
Thanks,
Chris
_______________________________________________
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