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 (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 arch...@mail-archive.com

Reply via email to