• 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: Table with all Key-Value Pairs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Table with all Key-Value Pairs (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Table with all Key-Value Pairs (From: Volker in Lists <email@hidden>)

  • Prev by Date: Re: Combing Bindings with Target-Action
  • Next by Date: Re: Best way to pass large objects between tasks?
  • Previous by thread: Re: Table with all Key-Value Pairs
  • Next by thread: sending email form Cocoa app using Mail
  • Index(es):
    • Date
    • Thread