• 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: [NSObject setValue:forUndefinedKey:] no longer requires explicit KVC notifications?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSObject setValue:forUndefinedKey:] no longer requires explicit KVC notifications?


  • Subject: Re: [NSObject setValue:forUndefinedKey:] no longer requires explicit KVC notifications?
  • From: Gabriele de Simone <email@hidden>
  • Date: Mon, 10 Aug 2009 08:36:59 -0400


The KVC infrastructure did not always generate value-changed notifications for setValue:forUndefinedKey: overrides.

The setValue:forUndefinedKey: override should have nothing to do with it. It's the setValue:forKey: call -- the one which provokes the call to setValue:forUndefinedKey: -- that's responsible for triggering the KVO change notifications.


Doubting my own sanity (always a good approach, IMO) I searched for, and found some evidence of this in an old discussion:

http://www.cocoabuilder.com/archive/message/cocoa/2006/10/12/172593

That thread doesn't confirm what you're saying. It says the opposite. It says what I just said. If you override setValue:foKey: _then_ you lose automatic KVO notifications and would have to reimplement them yourself, but if you just override setValue:forUndefinedKey: you don't have that problem.

Indeed! I feel like a jackass, thanks for catching this :-)

Gabe
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: [NSObject setValue:forUndefinedKey:] no longer requires explicit KVC notifications? (From: Gabriele de Simone <email@hidden>)
 >Re: [NSObject setValue:forUndefinedKey:] no longer requires explicit KVC notifications? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Implementing key view loop in custom NSView
  • Next by Date: Maintaining an ordered array of attributes in an NSTextStorage subclass
  • Previous by thread: Re: [NSObject setValue:forUndefinedKey:] no longer requires explicit KVC notifications?
  • Next by thread: [iPhone 3.0] UIImage startAnimating -- how to tell when it's finished?
  • Index(es):
    • Date
    • Thread