Re: Table with all Key-Value Pairs
Re: Table with all Key-Value Pairs
- Subject: Re: Table with all Key-Value Pairs
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 16 Apr 2009 14:29:14 +0700
On 15 Apr 2009, at 19:44, Volker in Lists wrote:
You may want to download an example from Apple ;-) : http://developer.apple.com/samplecode/DictionaryController/index.html
Thanks for this link. It did help me a lot.
One problem though:
If I bind the content of my dictionary controller to "selectedObjects"
of my array controller, then I get an exeption: "Cannot create
NSDictionary from object () of class NSCFArray".
Makes sense: the content of the array controller is bound to some
instance variable which is initially nil.
The workaround (also used in samplecode/DictionaryController): observe
the array controller forKeyPath: @"selectionIndexes" and set some
instance variable (like currentlySelectedDictionary) from
"selectedObjects" whenever the selection changes.
Then bind the content of my dictionary controller to
"currentlySelectedDictionary".
Looks kind of clumsy, but works.
Is there some more elegant way?
Kind regards,
Gerriet.
_______________________________________________
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