Type Property

NSManagedObjectContextDidSave

A notification that the context completed a save.

Declaration

static let NSManagedObjectContextDidSave: NSNotification.Name

Discussion

The notification object is the managed object context. The userInfo

dictionary contains the following keys: NSInsertedObjectsKey, NSUpdatedObjectsKey, and NSDeletedObjectsKey.

You can only use the managed objects in this notification on the same thread on which it was posted.

You can pass the notification object to mergeChanges(fromContextDidSave:) on another thread, however you must not use the managed object in the user info dictionary directly on another thread. For more details, see Concurrency with Core Data.

See Also

Managing Notifications

static let NSManagedObjectContextObjectsDidChange: NSNotification.Name

A notification of changes made to managed objects associated with this context.

static let NSManagedObjectContextWillSave: NSNotification.Name

A notification that the context is about to save.

let NSInsertedObjectsKey: String

A key for the set of objects that were inserted into the context.

let NSUpdatedObjectsKey: String

A key for the set of objects that were updated.

let NSDeletedObjectsKey: String

A key for the set of objects that were marked for deletion during the previous event.

let NSRefreshedObjectsKey: String

A key for the set of objects that were refreshed but were not dirtied in the scope of this context.

let NSInvalidatedObjectsKey: String

A key for the set of objects that were invalidated.

let NSInvalidatedAllObjectsKey: String

A key that specifies that all objects in the context have been invalidated.