Re: Bind to element in dictionary in array
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