I have a question regarding bindings: when I bind the value of a TableColumn to a controller, I specify the key path as something like this: @"arrangedObjects.name". So each row of the table, displays the "name" field from an object in the "arrangedObjects" property of the controller. In the IB it's actually broken into the controller key, "arrangedObjects", and the keypath, "name", though i don't see how this impacts the bind:toObject:withKeyPath:options: method.

When I modify a value in a view, I send the setValue:forKey: message to the controller. What I don't understand is how the TableColumn is specifying the particular instance in the "arrangedObjects" array that was changed. If I just say this:

        [controller setValue:@"new value" forKey:@"arrangedObjects.name"]

the specific instance is not specified. What is actually happening under the covers here?

One possibility I can think of is that it uses the collection accessor pattern (objectIn<Key>AtIndex:) to retrieve the object, then use the setValue:forKey: on the individual object.

I'm trying to use bindings to link a custom view to NSManagedObject instances. The view uses cells to represent each element of the controller collection, in a fashion analogous to TableColumn.

Thanks for any help.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to