Entities and Models

Entities live at the top of the Core Data hierarchy. They describe objects stored inside your database. Entities provide the virtual cookie cutters that specify how each data object is created. When you build new objects, entities detail the attributes and relationships that make up each object. Every entity has a name, which Core Data uses to retrieve entity descriptions as your application runs.

You build entities inside model files. Each project that links against the Core Data framework includes one or more model files. These .xcdatamodeld files define entities, their attributes, and their relationships.

Get The Core iOS Developer’s Cookbook, Fifth Edition 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.