KVO question
KVO question
- Subject: KVO question
- From: "Peter Boctor" <email@hidden>
- Date: Mon, 22 May 2006 17:29:21 -0700
I have a class "foo" that keeps track of a "current" object. Another class
wants to know:
1. When foo's "current" object changed
2. When the property "bar" on foo's "current" object has changed.
and uses the following code:
[foo addObserver:self
forKeyPath:@"current"
options:NSKeyValueObservingOptionNew
context:NULL];
[foo addObserver:self
forKeyPath:@"current.bar"
options:NSKeyValueObservingOptionNew
context:NULL];
When the "current" object changes, observeValueForKeyPath is called twice,
once with a keyPath of "current" and a second time with a keyPath of "
current.bar". How can the observeValueForKeyPath implementation determine
what actually changed, "current" or "current.bar"?
-peter
_______________________________________________
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