Manual KVO and will/didChangeValueForKey
Manual KVO and will/didChangeValueForKey
- Subject: Manual KVO and will/didChangeValueForKey
- From: Andrew White <email@hidden>
- Date: Thu, 02 Jun 2005 15:47:55 +1000
The NSKeyValueObservingProtocol specifies that a NSKeyValueChangeKindKey of
NSKeyValueChangeSetting indicates
"that willChangeValueForKey:/didChangeValueForKey: has otherwise been invoked".
Is it possible to tell which of the two was invoked? Does it make any
difference for the implementer of
observeValueForKeyPath:ofObject:change:context: ?
I ask because I have a situation where one of my properties is effectively
defined as
- (NSArray *) property
{
[[otherclass property] asArray];
}
I'd like to be able to mirror the will/did messages from otherclass in this
class. I'd also like to make sure that I don't update data twice in
observeValueForKeyPath:ofObject:change:context:, once on the
willChangeValueForKey and once on the didChangeValueForKey.
Note that although 'property' is (in this case) defined as an array it is
always updated as an entity, never by element.
Thanks
--
Andrew White
--------------------------------------------------------------------------
This email and any attachments may be confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
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