Creating the Project

This part of the tutorial guides you through creating the CDCLI project.

Create a New Project

Core Data is integrated into the Cocoa (and Cocoa Touch) framework, so any Cocoa or Foundation application can use it. The CDCLI program you’ll build is Foundation Tool that uses Core Data.

Create the project

Follow these steps to create the initial project:

  1. Launch Xcode.

  2. Create a project with these characteristics:

    • Platform: OS X

    • Template family: Application

    • Template name: Command Line Tool

    • Type: Foundation

    • Use Automatic Reference Counting

    The name of the project is not important.

Link the Core Data framework

  1. Add the Core Data framework to the project’s target. (A Foundation tool does not automatically link against the Core Data framework, which is why you need to add it.)

  2. Add an import statement to the main source file:

    #import <CoreData/CoreData.h>

What Happened?

You created a very simple Foundation Tool project and added the Core Data framework. This emphasizes that there’s no need to use a graphical user interface using the Application Kit or UIKit. It is not even necessary to use the Xcode data modeling tool—in the next chapter you will create the model entirely in code. Using the modeling tool does, however, saves you a lot of time and effort.