Re: valueForKey: on collections [was: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject]
Re: valueForKey: on collections [was: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject]
- Subject: Re: valueForKey: on collections [was: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject]
- From: "Owen Yamauchi" <email@hidden>
- Date: Sat, 28 Jun 2008 18:35:59 -0700
On Sat, Jun 28, 2008 at 6:24 PM, Ben Trumbull <email@hidden> wrote:
>> Which is, frankly, a bit goofy and, thus, the primary reason why I
>> would avoid using -valueForKey: on a dictionary.
>
> Amen. It's slower, and people reading your code can get very confused.
Then is there a recommended way of binding to the contents of
dictionaries? For example, suppose I have an NSObjectController
representing some object, which has an NSDictionary (let's say it's
called "attributes") as a property. Then can I bind to the value
stored under a key in that dictionary? Say I want to bind a text
field's value to whatever is stored under the key "name" in the
"attributes" dictionary. The intuitive (to me) thing to do is bind to
the NSObjectController, controller key "selection", model key path
"attributes.name". But that won't work. Is there a good solution?
Owen
_______________________________________________
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