Re: KVC Compliance Document: What if ivar in an NSSet?
Re: KVC Compliance Document: What if ivar in an NSSet?
- Subject: Re: KVC Compliance Document: What if ivar in an NSSet?
- From: mmalc crawford <email@hidden>
- Date: Fri, 14 Dec 2007 13:39:01 -0800
On Dec 14, 2007, at 12:14 PM, Jerry Krinock wrote:
In the Key Value Programming Coding Guide > Ensuring KVC Compliance,
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Compliant.html
It says:
"For to-many relationships, KVC compliance requires that...Your
class implements a method named -<key> that returns an array..."
I would say that an NSSet ivar is a to-many relationship. Does this
mean that my accessors must translate NSSet <-> NSArray, or am I
reading the documentation too literally?
That document hasn't been updated to discuss sets. The pattern for
sets is described at <http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/mutableSetValueForKey:
>.
A common reason for having a relationship represented by a set is
because you're using Core Data. If this the case, then the relevant
accessor methods are fully described here <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html
>
mmalc
_______________________________________________
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