On Jan 21, 2009, at 01:11, mmalc Crawford wrote:

It's not clear why this is any more satisfactory than the previous...

It's just that the previous one appeared to be talking about what to implement, not what to call. *That* is only an issue because the main text at

http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/AccessorConventions.html#/ /apple_ref/doc/uid/20002174-178830-BAJEDEFB

obscures what ought to be obvious or explicit -- that what you implement *is* what you call (or can be). For example, in that section, talking about getters:

Supporting to-many relationships in this manner requires that your class implement two methods using the naming pattern -countOf<Key> and -objectIn<Key>AtIndex:. [...] Implementing these methods allows your application to invoke valueForKey: using the key for the to- many property.

It appears to be making a clear distinction between what you implement and what you call. "Implement this, invoke that." Or, later, for setters:

The key-value coding methods mutableArrayValueForKey: and mutableArrayValueForKeyPath: provide mutable access to a to-many relationship [...]. In order to support these methods, your class must implement two additional methods for each of these keys: - insertObject:in<Key>AtIndex: and -removeObjectFrom<Key>AtIndex:.
Same distinction. "Implement these, mutable access via those", it appears to say. It speaks the truth, just not enough of it.
"'Ensuring KVO Compliance' at <http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/KVOCompliance.html#//apple_ref/doc/uid/20002178 > should make explicit whether a class that allows automatic observer notifications for a property will automatically emit KVO change notifications for KVC-compliant collection mutators."

So this is not the only place that really needs just a little bit of clarifying wording.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to