Before you can use any data, you have to initialize Core Data for the app. You need objects for each of the three classes shown in Figure 9-1. When you become more familiar with Core Data, this is something you will probably do in your own helper class, as described in Chapter 1 of Learning Core Data for iOS: A Hands-on Guide to Building Core Data Applications by Tim Roadley. If you know your app will use Core Data before you create the project, some of the application creation templates provided by Xcode have a check box to use Core Data.
In this chapter, you use code based on the Master–Detail Application template from Xcode. The only modifications are adding an import of
CoreData.h and two
#defines for the ...