Merge Policies

Define standard ways to handle conflicts during a save operation.

Overview

NSErrorMergePolicy is the default policy. It is the only policy that requires action to correct any conflicts. The other policies make a save go through silently by making changes that follow rules specific to that policy.

Topics

Policies

NSErrorMergePolicy

Default policy for all managed object contexts.

NSMergeByPropertyStoreTrumpMergePolicy

A policy that merges conflicts between the persistent store’s version of the object and the current in-memory version by individual property, with the external changes trumping in-memory changes.

NSMergeByPropertyObjectTrumpMergePolicy

A policy that merges conflicts between the persistent store’s version of the object and the current in-memory version by individual property, with the in-memory changes trumping external changes.

NSOverwriteMergePolicy

A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by pushing the entire in-memory object to the persistent store.

NSRollbackMergePolicy

A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by discarding all state for the changed objects in conflict.

NSMergePolicyType

Constants that define merge policy types.

See Also

Defining Merge Policies

errorMergePolicy

Default policy for all managed object contexts.

mergeByPropertyObjectTrumpMergePolicy

A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by individual property, with the external changes trumping in-memory changes.

mergeByPropertyStoreTrumpMergePolicy

A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by individual property, with the in-memory changes trumping external changes.

overwriteMergePolicy

A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by pushing the entire in-memory object to the persistent store.

rollbackMergePolicy

A policy that merges conflicts between the persistent store's version of the object and the current in-memory version by discarding all state for the changed objects in conflict.