Class

NSMergePolicy

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

Overview

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.

Symbols

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.

Constants

Merge Policies

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

NSMergePolicyType

Constants to define merge policy types.

Relationships

Inherits From

Conforms To