• 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: Problem using dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using dictionary


  • Subject: Re: Problem using dictionary
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 8 Oct 2010 11:34:34 -0700

On Oct 8, 2010, at 04:47, Remco Poelstra wrote:

> Is there a reason valueForKey: is documented directly but valueForKeyPath: is not?

They're both documented, but it requires familiarity with how to read the Cocoa documentation, which is an important point that goes beyond just this example.

The methods are documented as part of the NSKeyValueCoding protocol here:

	http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html

It's briefly mentioned, in that document and slightly more definitively in:

	http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Overview.html

that there's a default implementation of NSKeyValueCoding in NSObject. NSDictionary inherits this behavior from NSObject, but because the default 'valueForKeyPath:' is documented as operating in terms of 'valueForKey:', NSDictionary only needs to override the latter, and its own documentation only needs to document the override.

The point is to keep in mind that the behavior of objects is documented in their reference guides *and* those of their superclasses.


_______________________________________________

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: Problem using dictionary
      • From: Remco Poelstra <email@hidden>
References: 
 >Problem using dictionary (From: Remco Poelstra <email@hidden>)
 >Re: Problem using dictionary (From: Remco Poelstra <email@hidden>)

  • Prev by Date: Return value of performSelector:onThread:?
  • Next by Date: Re: Not understanding NSString's compare:options:range:locale: method
  • Previous by thread: Re: Problem using dictionary
  • Next by thread: Re: Problem using dictionary
  • Index(es):
    • Date
    • Thread