Re: Boggled By Bindings
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