• 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: Boggled By Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Boggled By Bindings


  • Subject: Re: Boggled By Bindings
  • From: Steven Kramer <email@hidden>
  • Date: Thu, 7 Oct 2004 15:02:32 +0200


Op 6-okt-04 om 12:57 heeft Patrick Machielse het volgende geschreven:

Because the array controller performs manual notification would be my
guess.

That does _sound_ logical: if the controller doesn't automatically notify
observers, but observers still get notified, the controller _must be_
notifying observers manually.

However, that begs the question: what would be the difference between manual
and automatical notification? Either the obeject notifies observers, or it
doesn't, in which case there isn't much use in registring or binding.

Maybe I'm missing something, but wouldn't the method be better named
'notifiesObserversForKey:'?

I don't see the difference between notifying and 'automatically' notifying?
I fear I don't fully grasp the concept here :-(



Using manual notification, your 'set' method will do (something similar to)

- (void) setMyKey: (int) newMyKey
{
[self willChangeValueForKey: @"myKey"];
myKey = newMyKey;
[self didChangeValueForKey: @"myKey"];
}

Using automatic notification, your 'set' method will be transparently overridden at run-time to send didChange/willChange. That is, the bindings run-time support will send those messages before/after your setMyKey is called. Your setter does not need to know anything about KVO.


Regards

Steven

_______________________________________________
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
References: 
 >Re: Boggled By Bindings (From: Patrick Machielse <email@hidden>)

  • Prev by Date: Multi-window documents
  • Next by Date: Calling an Obj-C method from a C++ class, how?
  • Previous by thread: Re: Boggled By Bindings
  • Next by thread: Re: Boggled By Bindings
  • Index(es):
    • Date
    • Thread