Propagation of KVO through bindings
Propagation of KVO through bindings
- Subject: Propagation of KVO through bindings
- From: "Hamish Allan" <email@hidden>
- Date: Wed, 16 Apr 2008 16:49:35 +0200
Hi,
If I set up key-value observing of an NSArrayController's
arrangedObjects like so:
[myArrayController addObserver:self forKeyPath:@"arrangedObjects"
options:(NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew)
context:nil];
I get informed when the array controller's content changes.
Now if I set up an extra level of indirection:
myDictionary = [[NSMutableDictionary alloc] init];
[myDictionary bind:@"boundArrangedObjects" toObject:myArrayController
withKeyPath:@"arrangedObjects" options:nil];
[myDictionary addObserver:self forKeyPath:@"boundArrangedObjects"
options:(NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew)
context:nil];
I would expect to be informed of the change twice, but though (if I
log its contents) myDictionary.array seems to be being kept up to
date, KVO is not informing me of the change through the binding.
Is this expected behaviour, and if so, is it possible to get the
notifications I want some other way?
Thanks,
Hamish
P.S. I have tried the array controller in both entity and class modes
and it seems to make no difference.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden