• 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: Detecting reading a key in KVC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting reading a key in KVC


  • Subject: Re: Detecting reading a key in KVC
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 12 Nov 2010 12:20:53 -0800

On Nov 12, 2010, at 12:05, Remco Poelstra wrote:

> If I understand it correctly, for all properties, each and everytime, valueForUndefinedKey is called?

Correct.

> So I do also need to override setValue:forUndefinedKey in case 2? To make sure that the properties end up in the dictionary?

Correct. I omitted the setter behavior for brevity in the discussion.

> Basically it's the same to what I've now (based on the discussion with Graham), but adding "Undefined" to my method names, I do keep the performance enhancements of the original implementation?

It has *better* performance than the original implementation. Originally, *every* call to 'valueForKey:' involved custom code and an extra dictionary lookup. With this implementation, that only happens for your keys -- and genuinely undefined keys, of course.


_______________________________________________

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: 
 >Detecting reading a key in KVC (From: Remco Poelstra <email@hidden>)
 >Re: Detecting reading a key in KVC (From: "email@hidden" <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Quincey Morris <email@hidden>)
 >Re: Detecting reading a key in KVC (From: "email@hidden" <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Quincey Morris <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Remco Poelstra <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Graham Cox <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Remco Poelstra <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Graham Cox <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Ken Thomases <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Graham Cox <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Ken Thomases <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Remco Poelstra <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Quincey Morris <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Remco Poelstra <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Quincey Morris <email@hidden>)
 >Re: Detecting reading a key in KVC (From: Remco Poelstra <email@hidden>)

  • Prev by Date: Re: Detecting reading a key in KVC
  • Next by Date: forcing accessibility focus
  • Previous by thread: Re: Detecting reading a key in KVC
  • Next by thread: Re: Detecting reading a key in KVC
  • Index(es):
    • Date
    • Thread