<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSManagedObjectContext/mergeChanges(fromRemoteContextSave:into:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSManagedObjectContext(cm)mergeChangesFromRemoteContextSave:intoContexts:"
  },
  "title" : "mergeChanges(fromRemoteContextSave:into:)"
}
-->

# mergeChanges(fromRemoteContextSave:into:)

Handles changes from other processes or from a serialized state.

```
class func mergeChanges(fromRemoteContextSave changeNotificationData: [AnyHashable : Any], into contexts: [NSManagedObjectContext])
```

## Discussion

This method more efficiently merges changes into multiple contexts as well as nested contexts. The dictionary keys should be one or more from an <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/NSManagedObjectContextObjectsDidChange>:  [`NSInsertedObjectsKey`](/documentation/CoreData/NSInsertedObjectsKey), [`NSUpdatedObjectsKey`](/documentation/CoreData/NSUpdatedObjectsKey), [`NSDeletedObjectsKey`](/documentation/CoreData/NSDeletedObjectsKey). The values should be an <doc://com.apple.documentation/documentation/Foundation/NSArray> of either [`NSManagedObjectID`](/documentation/CoreData/NSManagedObjectID) or <doc://com.apple.documentation/documentation/Foundation/NSURL> objects conforming to valid results from [`uriRepresentation()`](/documentation/CoreData/NSManagedObjectID/uriRepresentation()).

---

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)