Re: Confused about bindings
Re: Confused about bindings
- Subject: Re: Confused about bindings
- From: mmalc crawford <email@hidden>
- Date: Sun, 19 Nov 2006 07:28:59 -0800
On Nov 19, 2006, at 6:50 AM, David Aames wrote:
But as I was reading through the docs ("View Initiated Updates",
Bindings Programming Guide) it says the view has to send the new
values to the controller ("Communicate view values to the controller
to which it is bound") and the method call they show is:
[observedObjectForAngle setValue: newControllerAngle forKeyPath:
observedPathForAngle];
But doesn't this actually bypass the controller?
No, because the observed object is the controller.
So are we actually supposed to use KVC to update the model objects
ourselves (i.e. implement in on our own in our custom views)?
No, as the documentation shows you update the object to which you're
bound.
If that is the case wouldn't it be better to implement the updating
in the setters and not in updateForMouseEvent: as it is shown in the
docs?
No, because that would potentially lead to an infinite loop when the
model subsequently sends a KVO change notification.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden