Creating a data model
The data model is where you create your app's model objects and their properties. For our project, we only need to create one model object, called Review. Let's create a Managed Object Model now:
- In the Navigator panel, right-click on the
Common
folder and create a new group, calledCore Data
. - Next, right-click this new
Core Data
folder and click New File. - Inside the Choose a template for your new file screen, select iOS at the top, and then scroll down to the Core Data section and select Data Model. Then, hit Next:
- Name the file
LetsEatModel
and click Create. - Click Add Entity in the screen that appears:
- Then, in the new screen, in the bottom-right corner, change the Editor Style to see the Graph Style:
- In the Graph Style, double click on Entity in the box in the middle of the graph to change our Entity's name:
- Update the text to say Review and then hit Enter.
Now that we have our first Entity created, let's add our first attribute:
- Select our Review Entity...