Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Describing Property Relationships

Class descriptions provide a method of describing the to-one and to-many properties in a class. Defining these relationships between class properties allows for more intelligent and flexible manipulation of these properties with key-value coding.

Contents:

Class Descriptions
NSKeyValue


Class Descriptions

NSClassDescription is a base class that provides the interface for obtaining meta-data about classes. A class description object records the available attributes of objects of a particular class and the relationships (one-to-one, one-to-many, and inverse) between objects of that class and other objects. For example the attributes method returns the list of all attributes defined for a class; the methods toManyRelationshipKeys and toOneRelationshipKeys return arrays of keys that define to-many and to-one relationships; and inverseRelationshipKey: returns the name of the relationship pointing back to the receiver from the destination of the relationship for the provided key.

NSClassDescription does not define methods for defining the relationships. Concrete subclasses must define these methods. Once created, you register a class description with the NSClassDescription registerClassDescription:forClass: class method.

NSScriptClassDescription is the only concrete subclass of NSClassDescription provided in Cocoa. It encapsulates an application’s scripting information.

NSKeyValue

The Java class NSKeyValue provides methods for modifying the properties of an object using key-value coding. This class goes beyond the capabilities of the NSKeyValueCoding interface by taking advantage of the information available for an object’s NSClassDescription. NSKeyValue uses this information to provide convenient methods for accessing individual elements of array properties and for automatically managing reciprocal relationships between objects.



< Previous PageNext Page > Hide TOC


Last updated: 2007-06-06




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice