KVO one-step listening but two-step notifying?
KVO one-step listening but two-step notifying?
- Subject: KVO one-step listening but two-step notifying?
- From: Hamish Allan <email@hidden>
- Date: Fri, 23 Dec 2005 00:14:20 +0000
Hi,
I'm trying to implement an KVO-compliant object which proxies a KVO-
compliant property from either one object or another, depending on an
internal setting.
- (id)property
{
if (_setting)
return [_object1 property];
else
return [_object2 property];
}
I can register for change notifications for the appropriate key on
both _object1 and _object2, but these notifications come in the form
of observeValueForKeyPath:ofObject:change:context: messages. To
ensure that my dependents are properly notified, I am supposed to
send two messages: a "willChange" message prior to the change, and a
"didChange" afterwards, but as far as I can tell I only get the
observeValue.. message when _objectN property has already changed.
What is the best way to ensure KVO compliance in this case?
Thanks,
Hamish
_______________________________________________
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