O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required