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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to