<!--
{
  "documentType" : "article",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/merge-policies",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Merge Policies"
}
-->

# Merge Policies

Define standard ways to handle conflicts during a save operation.

## Discussion

`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`](/documentation/CoreData/NSErrorMergePolicy)

The default merge policy for all managed object contexts.

[`NSMergeByPropertyStoreTrumpMergePolicy`](/documentation/CoreData/NSMergeByPropertyStoreTrumpMergePolicy)

A property-based merge policy that applies external changes.

[`NSMergeByPropertyObjectTrumpMergePolicy`](/documentation/CoreData/NSMergeByPropertyObjectTrumpMergePolicy)

A property-based merge policy that applies in-memory changes.

[`NSOverwriteMergePolicy`](/documentation/CoreData/NSOverwriteMergePolicy)

A merge policy that overwrites the entire stored object.

[`NSRollbackMergePolicy`](/documentation/CoreData/NSRollbackMergePolicy)

A merge policy that discards unsaved changes.

[`NSMergePolicyType`](/documentation/CoreData/NSMergePolicyType)

Constants that define merge policy types.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)