• 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: Bind to element in dictionary in array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind to element in dictionary in array


  • Subject: Re: Bind to element in dictionary in array
  • From: Trygve Inda <email@hidden>
  • Date: Wed, 28 Jun 2006 17:48:05 +0000
  • Thread-topic: Bind to element in dictionary in array

> This is a very common question... which I found out after I recently
> got tripped up on it!
>
> You can't bind to an array like that. The confusing part for me is
> that [dict valueForKeyPath:@"MyArray.element1.someBoolValueD"] will
> return a perfectly fine array, but that same keypath can't be used
> for binding or kvo observing. (Well, maybe that does make some sense.)
>
> Anyway, you need to add a new ArrayController. Set its contentArray
> to "Dict.MyArray" and then you can bind to that. The ArrayController
> adds the KVO magic to the array.
>
> Hope that helps (and, um, I hope I'm correct. Since I recently got
> tripped on it, I don't guarantee anything!)
>
> George

Hmmm... Interesting.

The array (embedded in my main dict) is an array of dicts. The first element
of which I need to bind to user interface elements (checkboxes and menus).

I do not want to keep any local variables for the state of these GUI
elements - only to be bale to store them is the dict within the array.

So... For the NSArrayController...

What is the ObjectClassName?  The same as my PrefPane?

The array  contents will not be visible ina table view - they are just the
values of the GUI element setings.

Confused as to how to hook this up.

Thanks,

Trygve



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bind to element in dictionary in array
      • From: George Orthwein <email@hidden>
References: 
 >Re: Bind to element in dictionary in array (From: George Orthwein <email@hidden>)

  • Prev by Date: Binding beginner question
  • Next by Date: Idle-time processing in a runloop
  • Previous by thread: Re: Bind to element in dictionary in array
  • Next by thread: Re: Bind to element in dictionary in array
  • Index(es):
    • Date
    • Thread