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: George Orthwein <email@hidden>
- Date: Wed, 28 Jun 2006 13:04:25 -0400
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
_______________________________________________
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