• 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
Re: Manual KVO and will/didChangeValueForKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Manual KVO and will/didChangeValueForKey


  • Subject: Re: Manual KVO and will/didChangeValueForKey
  • From: Tim Lucas <email@hidden>
  • Date: Fri, 3 Jun 2005 12:48:31 +1000

On 03/06/2005, at 2:12 AM, mmalcolm crawford wrote:

On Jun 1, 2005, at 11:51 PM, Tim Lucas wrote:

On 02/06/2005, at 3:47 PM, Andrew White wrote:

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.

I think willChangeValueForKey: just gives the any NSEditor's the chance to finish their editing (anybody confirm this?) -- it won't send out a KVO change notification.


Umm, no. It gives the observation mechanism an opportunity to record pre-change values.

Ok my bad. I wasn't sure, and hence the "i think".

If willChangeValueForKey: is purely for the observation mechanism then maybe the docs should read "Invoked to inform *the key value observing mechanism* that the receiver is about to change the value of key" rather than "Invoked to inform *observers* that the receiver is about to change the value of key":
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Protocols/NSKeyValueObserving.html#//apple_ref/doc/uid/ 20002299-BBCCIJAJ


There's a few other places in that doc that might also need correcting along those lines, if that is indeed the case.

Maybe it should also be stated somewhere in that doc that it's the willChangeValueForKey: call that allows the KVO system to record pre-change values for those observers who've registered using NSKeyValueObservingOptionOld.

I've submitted it to bug reporter -- rdar://4138202

- tim lucas

_______________________________________________
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


References: 
 >Manual KVO and will/didChangeValueForKey (From: Andrew White <email@hidden>)
 >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? Still need help!
  • Next by Date: Re: linking to a styled private framework
  • Previous by thread: Re: Manual KVO and will/didChangeValueForKey
  • Next by thread: mutableSetValueForKey:, addObject:, and selector not found
  • Index(es):
    • Date
    • Thread