<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSErrorMergePolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:@NSErrorMergePolicy"
  },
  "title" : "NSErrorMergePolicy"
}
-->

# NSErrorMergePolicy

The default merge policy for all managed object contexts.

```
var NSErrorMergePolicy: AnyObject
```

## Discussion

If a save fails because of conflicting objects, you can find the IDs of those objects in error’s `userInfo` dictionary. Use the [`NSInsertedObjectsKey`](/documentation/CoreData/NSInsertedObjectsKey) and [`NSUpdatedObjectsKey`](/documentation/CoreData/NSUpdatedObjectsKey) keys to extract the object IDs.

---

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)