Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming
by Maurice Sharp, Erica Sadun, Rod Strougo
Adding the CDCar Model
Next, you need to create the file that Core Data uses to set up entities and other configurations. The same description file and editor can be used for anything from a simple single-entity configuration like CarValet to very complex models including multiple entities, entity properties, default values, and relationships.
Adding the car model takes just a few steps:
1. Add a new file to the project by using the Data Model template from the Core Data category. Call the file CarValet and add it just above Car.h.
2. Open the new CarValet.xdatamodeld if it is not already there. You should see an editor similar to the one in Figure 9-3.
Figure 9-3 Core Data editor
3. Add an entity called CDCar by clicking the Add Entity button ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access