A description of a property of a Core Data entity.


@interface NSPropertyDescription : NSObject


A property describes a single value within an object managed by the Core Data Framework. There are different types of property, each represented by a subclass which encapsulates the specific property behavior—see NSAttributeDescription, NSRelationshipDescription, and NSFetchedPropertyDescription.

Note that a property name cannot be the same as any no-parameter method name of NSObject or NSManagedObject. For example, you cannot give a property the name "description". There are hundreds of methods on NSObject which may conflict with property names—and this list can grow without warning from frameworks or other libraries. You should avoid very general words (like “font”, and “color”) and words or phrases which overlap with Cocoa paradigms (such as “isEditing” and “objectSpecifier”).

Properties—relationships as well as attributes—may be transient. A managed object context knows about transient properties and tracks changes made to them. Transient properties are ignored by the persistent store, and not just during saves: you cannot fetch using a predicate based on transients (although you can use transient properties to filter in memory yourself).

Editing Property Descriptions

Property descriptions are editable until they are used by an object graph manager (such as a persistent store coordinator). This allows you to create or modify them dynamically. However, once a description is used (when the managed object model to which it belongs is associated with a persistent store coordinator), it must not (indeed cannot) be changed. This is enforced at runtime: any attempt to mutate a model or any of its sub-objects after the model is associated with a persistent store coordinator causes an exception to be thrown. If you need to modify a model that is in use, create a copy, modify the copy, and then discard the objects with the old model.


Accessing Features of a Property


The entity description of the receiver.


A Boolean value that indicates whether the receiver should be indexed for searching.


A Boolean value that indicates whether the receiver is optional.


A Boolean value that indicates whether the receiver is transient.


The name of the receiver.


The user info dictionary of the receiver.

Supporting Validation


The validation predicates of the receiver.


The error strings associated with the receiver’s validation predicates.

- setValidationPredicates:withValidationWarnings:

Sets the validation predicates and warnings of the receiver.

Supporting Versioning


The version hash for the receiver.


The version hash modifier for the receiver.


The renaming identifier for the receiver.

Specifying Spotlight Support


A Boolean value that indicates whether the property should be indexed by Spotlight.


A Boolean value that indicates whether the property data should be written out in an external record file corresponding to the managed object.



Inherits From

Conforms To

See Also

Attributes and Relationships


A description of an attribute of a Core Data entity.


The possible types of Core Data attributes.


A description of an attribute of a Core Data entity that derives its value from one or more other properties.


A description of a relationship of a Core Data entity.