Re: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?
Re: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?
- Subject: Re: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?
- From: Jerry Krinock <email@hidden>
- Date: Mon, 11 Jan 2010 09:01:19 -0800
On 2010 Jan 11, at 03:47, Quincey Morris wrote:
> On Jan 10, 2010, at 19:58, Jerry Krinock wrote:
>
>> toObject:segmentedControl
>
> You *didn't* "bind an NSSegmentedControl to its window controller", you actually bound a window controller['s "foo" binding] to [the "selectedSegment" property of] a NSSegmentedControl.
Oops, you're correct. Like the method says, bind:*to*:segmentedControl.
> IIRC the bindings documentation isn't clear which direction "is bound to" refers to and/or it gives the impression that a binding is symmetric (which it may effectively be at the level of notifications, but it isn't at the level of establishing bindings between objects).
When I first heard the word "binding", from other uses in English, I assumed that it was two-way, and labored under this incorrect assumption for quite awhile. Now I know that a binding is only one way, and further that change data flows in the *opposite* direction of the *to*. That is, if I bind myself *to* you, I observe what you do and your changes flow back *to* me.
I wonder why bindings was not as an extension of KVO, instead of as a separate sideshow. The effect is the same as KVO, with the addition that a designated setter is automatically invoked in the observer when a change is observed.
And then there's the whole thing about the separate namespaces for "bindings" and "properties", not to mention the three definitions of the word binding to mean
1. (verb) the act of binding
2. (noun) the connection that you get when you make a binding
3. (noun) the name of the property that gets bound in the receiver
I wrote a little document for myself where I actually use the words binding(1), binding(2) and binding(3).
Scott, if I ever get to point that I think I know what I'm talking about, I might file a bug to suggest that the whole Cocoa Bindings Reference be destroyed and its pages page added as a "Bindings" section to the regular API documentation of the "bound" classes.
Thanks for the discussion. I hope I didn't make any more "bind" mistakes in the above!
_______________________________________________
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