---
title: "mergeChanges(fromContextDidSave:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsmanagedobjectcontext/mergechanges(fromcontextdidsave:)"
---

# mergeChanges(fromContextDidSave:)

Merges the changes specified in a given notification.

## Declaration

```swift
func mergeChanges(fromContextDidSave notification: Notification)
```

## Parameters

- `notification`: An instance of an doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/NSManagedObjectContextDidSave notification posted by another context.

## Mentioned in

Accessing data when the store changes Consuming relevant store changes

## Discussion

Discussion This method refreshes any objects which have been updated in the other context, faults in any newly-inserted objects, and invokes delete(_:): on those which have been deleted. You can pass a NSManagedObjectContextDidSave notification posted by a managed object context on another thread, however you must not use the managed objects in the user info dictionary directly. For more details, see Concurrency with Core Data. note: Objective-C uses instances of NSManagedObjectContextDidSaveNotification instead of NSManagedObjectContextDidSave.

## See Also

### Managing concurrency

- [NSManagedObjectContextQueryGenerationKey](coredata/nsmanagedobjectcontextquerygenerationkey.md)
- [mergeChanges(fromRemoteContextSave:into:)](coredata/nsmanagedobjectcontext/mergechanges(fromremotecontextsave:into:).md)
- [automaticallyMergesChangesFromParent](coredata/nsmanagedobjectcontext/automaticallymergeschangesfromparent.md)
- [concurrencyType](coredata/nsmanagedobjectcontext/concurrencytype-swift.property.md)
- [mergePolicy](coredata/nsmanagedobjectcontext/mergepolicy.md)
- [queryGenerationToken](coredata/nsmanagedobjectcontext/querygenerationtoken.md)
- [transactionAuthor](coredata/nsmanagedobjectcontext/transactionauthor.md)
- [setQueryGenerationFrom(_:)](coredata/nsmanagedobjectcontext/setquerygenerationfrom(_:).md)
