Skip navigation.
 
mlRe: Boggled By Bindings
FROM : Steven Kramer
DATE : Thu Oct 07 15:02:32 2004

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

Related mailsAuthorDate
mlBoggled By Bindings Patrick Machielse Sep 30, 22:32
mlRe: Boggled By Bindings Jacob Lukas Oct 1, 00:55
mlRe: Boggled By Bindings Scott Stevenson Oct 1, 01:14
mlRe: Boggled By Bindings Scott Stevenson Oct 1, 01:20
mlRe: Boggled By Bindings Jacob Lukas Oct 1, 01:26
mlRe: Boggled By Bindings Scott Stevenson Oct 1, 02:46
mlRe: Boggled By Bindings Jacob Lukas Oct 1, 03:09
mlRe: Boggled By Bindings Scott Stevenson Oct 1, 05:05
mlRe: Boggled By Bindings Jacob Lukas Oct 1, 08:18
mlRe: Boggled By Bindings Christian Brunsche… Oct 1, 11:03
mlRe: Boggled By Bindings Patrick Machielse Oct 1, 11:24
mlRe: Boggled By Bindings Patrick Machielse Oct 1, 13:26
mlRe: Boggled By Bindings Patrick Machielse Oct 1, 13:35
mlRe: Boggled By Bindings Eric Ocean Oct 1, 17:37
mlRe: Boggled By Bindings Scott Stevenson Oct 1, 23:38
mlRe: Boggled By Bindings Scott Stevenson Oct 1, 23:40
mlRe: Boggled By Bindings Patrick Machielse Oct 4, 13:56
mlRe: Boggled By Bindings Steven Kramer Oct 4, 17:09
mlRe: Boggled By Bindings Patrick Machielse Oct 6, 12:57
mlRe: Boggled By Bindings Steven Kramer Oct 7, 15:02