iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
The Core Data Environment
Core Data is able to hide the mechanics of persistence so that app code is able to work directly with model objects with no worries about how they are stored or saved. To do this, Core Data utilizes four major classes to define the environment: NSManagedObjectModel, NSPersistentStoreCoordinator, NSPersistentStore, and NSManagedObjectContext. When a Core Data–enabled project is set up in Xcode, the template provides logic to set up instances of these four classes. Adding Core Data to a new project is a fairly quick exercise, because all that is needed is to set up a managed object model, do any customizations needed to the rest of the environment, and begin writing app logic to use it.
The pattern that the Core Data ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access