Relationships

The data model so far is not very useful. You can store and enumerate Passers, and you can do the same with Games, but quarterbacks participate in games, and Game is the only thing that holds a quarterback’s actual performance. Core Data calls the link between two entities a relationship.

9. Make sure the Passer entity is selected. A passer may start with no games played but will eventually play in many. Choose Add Relationship from the drop-down on the right-hand + button; click the + button under the Relationships table; or select Editor → Add Relationship. A new entry appears in the Relationships list.

Note

If you don’t see the new relationship, make sure the disclosure triangle next to the “Relationships” label is open.

Get Xcode 5 Start to Finish: iOS and OS X Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.