Instance Method

newBackgroundContext

Creates a private managed object context.

Declaration

- (NSManagedObjectContext *)newBackgroundContext;

Return Value

A newly created private managed object context.

Discussion

Invoking this method causes the persistent container to create and return a new NSManagedObjectContext with the concurrencyType set to NSPrivateQueueConcurrencyType. This new context will be associated with the NSPersistentStoreCoordinator directly and is set to consume NSManagedObjectContextDidSaveNotification broadcasts automatically.

See Also

Accessing the Context(s)

- performBackgroundTask:

Causes the persistent container to execute the block against a new private queue context.

viewContext

The managed object context associated with the main queue. (read-only)