Java Perspective: Advanced Core Data
For more information on Java development, visit our Java Reference Guide or sign up for our Java Newsletter.
Although it is possible to utilize Core Data with little or no coding on the part of the developer, what if you want or need more fine-grained control over the persistence layer in your application? This article walks you through the process of accessing a Core Data persistent store directly in code.
NSManagedObjectModel
The NSManagedObjectModel represents the model that the developer designs using XCode. It contains all the entities for the application, including all the attributes for those entities and the relationships. A Core Data application has at least one model and can contain as many as is necessary. The NSManagedObjectModel is similar in use to a database schema.
The model is not normally accessed directly by the developer other than to pass a pointer/reference to it to other objects such as the NSManagedObjectContext detailed below.