Core Data Tutorial for iPhone OS
Understanding a Core Data-Based Project
Together with various other supporting files, the template provides you with:
An application delegate class
A MainWindow interface (.xib) file
A Core Data model (.xcdatamodel) file.typically referred to as the managed object model
The application also links against the Core Data framework.
Of the resources, the first two should be familiar, although the details of the delegate class will be new. The model file is described later in “Managed Object and Model” (page 21). For now, examine the header file of the application delegate class. In addition to the standard window and view controller, it provides four other properties and a new method:
- (IBAction)saveAction:sender;
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, retain, readonly) NSManagedObjectContext
*managedObjectContext;
@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator
*persistentStoreCoordinator;
@property (nonatomic, readonly) NSString *applicationDocumentsDirectory;