Relationship
Relationship is established between two or more entities to explain how they are mutually associated to each other. In fact, the relationships allow the managed object of a particular entity to maintain references to the managed objects of another entity (destinations). In Core Data, the relationships are defined in the same way as the attributes are defined. The relationships are assigned a name, that serves as the key value to set and retrieve the object(s) represented by the relationship.
Note
The relationships are added to the entities in the Xcode's data model editor in the same way attributes are added.
Types of relationships
The relationship can be of three types:
One to one relationship
One to many relationship
Many to many relationship
One to one relationship
This relationship means a row in one entity will be associated with exactly one row in the destination entity. In other words, a managed object can contain a pointer to a single managed object of a specific entity. For...