Class

NSMergeConflict

A merge conflict encapsulates conflicts that occur when attempting to save changes in a managed object context.

Overview

There are two situations in which a conflict may occur:

  1. Between the Managed object context and its in-memory cached state at the Persistent store coordinator layer.

    In this case, the merge conflict has a source object and a cached snapshot but no persisted snapshot.

  2. Between the cached state at the Persistent store coordinator and the external store (file, database, etc.).

    In this case, the merge conflict has a cached snapshot and a persisted snapshot. The source object is also provided as a convenience, but it is not directly involved in the conflict.

Snapshot dictionaries include values for all attributes and to-one relationships, but not to-many relationships. Relationship values are NSManagedObjectID references. To-many relationships must be pulled from the persistent store as needed.

Symbols

Initializing a Merge Conflict

var sourceObject: NSManagedObject

The source object for the conflict.

var objectSnapshot: [String : Any]?

A dictionary containing the values of the source object.

var cachedSnapshot: [String : Any]?

A dictionary containing the values of the source object held in the persistent store coordinator layer.

var persistedSnapshot: [String : Any]?

A dictionary containing the values of the source object held in the persistent store.

var newVersionNumber: Int

The new version number for the change.

var oldVersionNumber: Int

The old version number for the change.

Relationships

Inherits From

Conforms To