• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Manual KVO and will/didChangeValueForKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Manual KVO and will/didChangeValueForKey
      • From: Tim Lucas <email@hidden>
    • Re: Manual KVO and will/didChangeValueForKey
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Custom objects in drag pasteboard?
  • Next by Date: Re: Manual KVO and will/didChangeValueForKey
  • Previous by thread: Re: Can't *READ* from my Resources Directory??? [SOLVED]
  • Next by thread: Re: Manual KVO and will/didChangeValueForKey
  • Index(es):
    • Date
    • Thread