NSRelationshipDescription
A description of a relationship between two entities.
Declaration
class NSRelationshipDescriptionOverview
NSRelationshipDescription provides additional attributes that are specific to modeling a relationship between two entities. For the common attributes of all property types, see NSPropertyDescription.
For example, use this class to define a relationship’s cardinality — the number of managed objects the relationship can reference.
For a to-one relationship, set maxCount to
1.For a to-many relationship, set maxCount to a number greater than
1to impose an upper limit; otherwise, use0to allow an unlimited number of referenced objects.
At runtime, you can modify a relationship description until you associate its owning managed object model with a persistent store coordinator. If you attempt to modify the model after you associate it, Core Data throws an exception. To modify a model that’s in use, create and modify a copy and then discard any objects that belong to the original model.