I'm trying to bind a property from a custom NSView to another on a custom NSObject. Both properties are simple bool value.
As a newbie with custom binding i've read Apple Documentation and searched on stackoverflow.
So I created a custom NSView and a custom NSObject, added a bool property called 'enabled' to both and bind them with [myCustomView bind:@"enabled" toObject:myObject withKeyPath:@"enabled" options:nil];
My customView use the approach explained in this article http://www.tomdalling.com/blog/cocoa/implementing-your-own-cocoa-bindings/ to notify value's changes and prevent memory retain issues.
I started my app, it works ! Wonderful ... but it's only one way binding ! When I click my customView, the custom object's property is updated (right) but if the custom object's property value change, my custom view's property isn't updated (Grrrr)
I'm a bit confused because as far as i understood custom bindings, Apple recommendation is to manually implement bind:toObject:withKeyPath:options and register an observer to track property's value changes and Tom Dalling's approach says the opposite.
So what is the best way to bind my properties in a bi-directional way ?