Creating Contexts
In Core Data, entities provide descriptions. Objects are actual class instances that you create from entity specifications. These instances all descend from the NSManagedObject class and represent entries in the database.
Core Data objects live within a managed object context. These contexts, which are instances of NSManagedObjectContext, each represent an object space within your application. This chapter uses a single object context, although more complex implementations may be required in your own apps, primarily to support multithreaded Core Data access.
In this single-object-context example, you establish your context as you start up your application and use that context for all object fetch requests from the stored 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