Skip to content
Commitwise
Menu

Managed object context

Also called: NSManagedObjectContext

A Core Data scratchpad on its own queue, where objects are created, changed and saved.

Definition

Every context runs on a queue: the view context on the main queue for the UI, background contexts on private queues. Objects belong to the context that loaded them and may only be used on its queue, inside perform. To use an object elsewhere, pass its NSManagedObjectID and load it in the other context.

In practice

An import of 5,000 notes runs in a background context; the list reads from the view context, which merges the save.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.