• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Confused about bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Confused about bindings
      • From: David Aames <email@hidden>
References: 
 >Confused about bindings (From: David Aames <email@hidden>)
 >Re: Confused about bindings (From: "Julien Jalon" <email@hidden>)
 >Re: Confused about bindings (From: David Aames <email@hidden>)

  • Prev by Date: Re: Confused about bindings
  • Next by Date: Re: Core Data And Required Bindings
  • Previous by thread: Re: Confused about bindings
  • Next by thread: Re: Confused about bindings
  • Index(es):
    • Date
    • Thread