Database Reference
In-Depth Information
Figure 2—The data model in grid view
Xcode understands how to compile this file. When Xcode encounters this file
during the compile process of a project, it compiles it into a binary form
ending with the extension
.mom
. We can also build this file from the command
line using the
momc
tool.
Editing the Data Model
In
Appendix 1,
Building a Foundation
, on page 209
, we started with a sample
project that already has a data model included. How did we create that data
model? To begin with, we told Xcode to create a new file (File > New > File...),
and we selected Data Model from the template, as shown in
Figure 3,
Creating
a new data model
, on page 4
.
This presents us with a blank data model ready to be edited. From here, in
grid view, we added the three entities being used in the project:
Recipe
,
RecipeIngredient
, and
Type
. We then added the attributes and relationships for
each of those entities. For a discussion of entities, attributes, and relation-
ships, take a look at
Section 1.4,
NSManagedObject
, on page 10
.