You use a merge policy object to resolve conflicts between the persistent store and in-memory versions of managed objects.


A conflict is a mismatch between state held at two different layers in the Core Data stack. A conflict can arise when you save a managed object context when you have stale data at some layer. There are two places in which a conflict may occur:

  • Between the managed object context and its in-memory cached state at the persistent store coordinator layer.

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

Conflicts are represented by instances of NSMergeConflict.


Using a Merge Policy

init(merge: NSMergePolicyType)

Returns a merge policy initialized with a given policy type.

func resolve(mergeConflicts: [Any])

Resolves the conflicts in a given list.


Merge Policies

Merge policy singleton objects that define standard ways to handle conflicts during a save operation.


Constants to define merge policy types.


Inherits From

Conforms To