Create a data model file to contain your app’s object structure.
- Core Data
The first step in working with Core Data is to create a data model file. Here you define the structure of your application’s objects, including their object types, properties, and relationships.
You can add a Core Data model file to your Xcode project when you create the project, or you can add it to an existing project.
Add Core Data to a New Xcode Project
In the dialog for creating a new project, select the Use Core Data checkbox.
The resulting project includes an
Add a Core Data Model to an Existing Project
Choose File > New > File and select from the iOS templates. Scroll down to the Core Data section, and choose Data Model:
Click Next. Name your model file, and select its group and targets.
.xcdatamodeld file with the name you specified is added to your project: