On Feb 2, 2010, at 8:42 AM, Jerry Krinock wrote:

> So now we have this paradox:
> 
> 1.  "Cocoa Bindings Programming Topics" says that bindings are bidirectional.
> 2.  bind:toObject:withKeyPath:options: documentation says it "establishes a 
> binding"
> 3.  bind:toObject:withKeyPath:options: implementation establishes something 
> which
>    is unidirectional.

No paradox, as I see it, because #3 is not precisely true. There is nothing in 
the docs that says it is unidirectional, except in the sense that there is 
always an active and passive partner (perhaps what Quincey meant by 
"asymmetrical").

As I understand the basic implementation of bind:toObject:withKeyPath:options: 

a. The receiver reads the value of keyPath of object, ostensibly storing it in 
its bound property (1st argument), then starts KVO on the object for key path.

b. Any time the receiver changes the bound property it issues a 
setValue:forKeyPath: message to the bound-to object.

c. Any time the receiver receives an observeValueForKeyPath: message from the 
bound-to object, it reads the value of keyPath of object, ostensibly storing it 
in a property identified by the first argument.

So, per the above, there is communication going both ways: the receiver is the 
active partner, doing a push-pull. The bound-to object doesn't even know 
(outside of the scope of KVO) that it is bound to another object, and doesn't 
do anything in that regard. In this sense, and in this sense alone, we could 
say that the binding is unidirectional.

Throwing my 2ยข into the mix,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list ([email protected])

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]

Reply via email to