Programmatic binding not working both ways?
Programmatic binding not working both ways?
- Subject: Programmatic binding not working both ways?
- From: "Doug Knowles" <email@hidden>
- Date: Tue, 8 Apr 2008 23:16:11 -0400
I'm using bind:toObject:withKeyPath:options: to programmatically set up
bindings from a set of proxy objects (the receiver) to various properties on
a model object, and while changes to the model properties are properly being
reflected in the proxies, changes to the proxy properties are not being
propagated back to the model as I expect.
I know I only have at most a couple of paragraphs to set this up, so:
I have a master-detail interface where the detail pane displays a list of
only the non-empty properties of the selection in the master table. (Sort
of like the Address Book, which only renders non-empty fields.) Edits in
the detail view need to be "pushed" back to the model object properties.
I'm using a two-column table for the detail view; the first column of each
row renders the label for a property, the second column shows the property
value. The table columns are bound to fieldName and fieldValue properties of
the "selection" of a subclass of NSArrayController. The content of the
NSArrayController is reset whenever the master selection is changed; the
content is comprised of the proxy objects, where each proxy represents a
single non-empty property of the selection. Each proxy object
uses bind:toObject:withKeyPath:options: to bind its fieldValue property to
the appropriate property of the selection.
This works to properly render and update the values in the detail table, but
editing the values in the detail table does not propagate changes back to
the selection (from where, I assume, they should be propagated back to the
model objects backing the master list.
Is there something more I need to do to make this happen?
TIA,
Doug K;
_______________________________________________
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