In addition to overloading existing terms, key-value coding defines some unique terminology of its own.
Key-value coding can be used to access three different types of object values: attributes, to-one relationships and to-many relationships. The term property refers to any of these types of values.
An attribute is a property that is a simple value, such as a scalar, string, or boolean value. Immutable objects such as NSColor and NSNumber are also considered attributes.
A property that specifies a to-one relationship is an object that has properties of its own. These underlying properties can change without the object itself changing. For example, an instance variable containing an NSMutableDictionary, would be a to-one relationship.
Finally, a property that specifies a to-many relationship consists of a collection of related objects. An instance of NSArray is commonly used to hold such a collection. However, key-value coding allows you to use custom classes for collections and still access them as if they were an NSArray by implementing the key-value coding accessors discussed in “Indexed Accessor Patterns for To-Many Properties.”
Last updated: 2007-06-06