• 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: Ken Thomases <email@hidden>
  • Date: Thu, 11 Nov 2010 10:30:47 -0600

On Nov 11, 2010, at 7:11 AM, Graham Cox wrote:

> Just write a wrapper for -setObject:forKey: and -valueForKey:  The first just calls the same method on its (mutable) dictionary, the second can first check for whether the value is actually present and if not kick off some task to fetch it, or else just get it from the dictionary and return it.

You should not override -setValue:forKey: or -valueForKey: if you can avoid it.  Instead, implement the methods -setValue:forUndefinedKey: and -valueForUndefinedKey:.  They are precisely for implementing "dynamic" properties in this manner.

Regards,
Ken

_______________________________________________

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

  • Follow-Ups:
    • Re: Detecting reading a key in KVC
      • From: Graham Cox <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>)

  • Prev by Date: Re: NSTextView vs NSTextField
  • Next by Date: Re: NSTableView within NSScrollView in code
  • Previous by thread: Re: Detecting reading a key in KVC
  • Next by thread: Re: Detecting reading a key in KVC
  • Index(es):
    • Date
    • Thread