I have two objects: a MyDocument (NSDocument subclass) and a custom MyController controller (NSObject subclass). In the MyDocument there is "currMode" property. The controller class also has the currMode property. I want these two properties to be bound to each other two-way, so that when either of the properties changes, the other updates respectively.
What I do: >From within MyDocument's windowControllerDidLoadNib message: [myController bind: @"currMode" toObject: self withKeyPath:@"currMode" options:nil]; I do not override bind, unbind etc. of MyController relying on the default implementation of bindings in NSObject. Now when the myController's currMode properties changes by its view, nothing happens in MyDocument. It's setCurrMode is not sent. What am I doing wrong? I have two accompanying questions: 1) Should I send the bind message to myDocument to observe myController as well? I used to think that bindings are two-way inherently, i.e. the object whose "bind" message is invoked, stores its observed object and when the observer's property changes, it updates the observed object automatically. Am I wrong? 2) Am I allowed to send [myController setCurrMode:] in order for the binding to fire, or am I obliged to always send [myController setValue:... forKey:@"currMode"] for this? _______________________________________________ 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 [EMAIL PROTECTED]