• 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: How to set up manual bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set up manual bindings


  • Subject: Re: How to set up manual bindings
  • From: Scott Anguish <email@hidden>
  • Date: Fri, 13 Feb 2004 11:01:32 -0800

On Feb 13, 2004, at 4:49 AM, Reni Puls wrote:

You have to admit, though, that the new Controller Layer has been the source of a lot of confusion since it was introduced. It's very easy to get excited about the cool new things you can do with bindings and KVO, and this naturally leads to frustration when you find out that it doesn't quite work as you had expected.


Well, certainly there are multiple reasons for that, not the least of which is that it's a bit of a new way of thinking.


If you simply want to ensure that two values are kept in sync without a controller, you are encouraged to use key-value observing.

<http://cocoa.mamasam.com/COCOADEV/2004/02/1/83965.php>

... effectively re-implementing something that (I thought) bindings already do.


No, not really.

KVO is used by the controllers, and by bindings, but you're not really needing to re-implement anything.

To be a controller in the bindings sense, you need to implement NSEditorRegistration, and the bindable object NSEditor. Those protocols control when the data is set, and related things like that.

You can't bind two objects directly without supporting those protocols. The UI items support one side, and the NSController supports the other.

KVO is actually the answer for your issue. and with automatic observing, you don't need to implement one side.. just register and observe

I just want to understand *why* Apple chose to make bindings one-way only. No blame, no bad feelings. Simple, pure curiosity. :-)


They're not.. they just need the appropriate protocols, and usually those require a controller to implement them. :-)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >How to set up manual bindings (From: René Puls <email@hidden>)
 >Re: How to set up manual bindings (From: René Puls <email@hidden>)
 >Re: How to set up manual bindings (From: mmalcolm crawford <email@hidden>)
 >Re: How to set up manual bindings (From: René Puls <email@hidden>)

  • Prev by Date: Re: static objects "autoreleased with no pool in place - just leaking"
  • Next by Date: Re: [Slightly OT] Shareware donation collection
  • Previous by thread: Re: How to set up manual bindings
  • Next by thread: Re: How to set up manual bindings
  • Index(es):
    • Date
    • Thread