• 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: Remco Poelstra <email@hidden>
  • Date: Fri, 8 Oct 2010 22:14:09 +0200

Op 8 okt 2010, om 20:34 heeft Quincey Morris het volgende geschreven:

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.

That seems reasonable, but makes the documentation harder to read. In the old days where I used Delphi, the inherited methods were all shown as such and it gives a direct overview of what is available. Especially in this case, where the valueForKey* methods are neither mentioned in the NSObject docs, not that NSObject followsNSKeyValueCoding. Well, maybe Apple adds such functionality someday to their doc browser.


Kind regards,

Remco Poelstra
_______________________________________________

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: Abhi Beckert <email@hidden>
    • Re: Problem using dictionary
      • From: Fritz Anderson <email@hidden>
References: 
 >Problem using dictionary (From: Remco Poelstra <email@hidden>)
 >Re: Problem using dictionary (From: Remco Poelstra <email@hidden>)
 >Re: Problem using dictionary (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Return value of performSelector:onThread:?
  • Next by Date: CPP reference operator
  • Previous by thread: Re: Problem using dictionary
  • Next by thread: Re: Problem using dictionary
  • Index(es):
    • Date
    • Thread