<!--
{
  "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/NSManagedObjectContextDidSaveNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:@NSManagedObjectContextDidSaveNotification"
  },
  "title" : "NSManagedObjectContextDidSaveNotification"
}
-->

# NSManagedObjectContextDidSaveNotification

A notification that posts after a context finishes writing unsaved changes.

```
extern NSString * const NSManagedObjectContextDidSaveNotification;
```

## Discussion

> Important:
> Use ``doc://com.apple.coredata/documentation/CoreData/NSManagedObjectContextDidSaveObjectIDsNotification`` instead of this notification.

This notification’s `object` is the saved context. Don’t peform any asynchronous work or block the calling thread. [`NSManagedObjectContext`](/documentation/CoreData/NSManagedObjectContext) posts notifications to the same thread that creates it.

The `userInfo` dictionary contains the inserted, updated, and deleted managed objects of the completed save. For the keys to access those objects, see [`NSManagedObjectContext.NotificationKey`](/documentation/CoreData/NSManagedObjectContext/NotificationKey). Don’t capture the dictionary’s contents.

To safely use the provided managed objects on the current thread, create a new context and use its [`mergeChanges(fromContextDidSave:)`](/documentation/CoreData/NSManagedObjectContext/mergeChanges(fromContextDidSave:)) method to merge in the notification’s changes.

---

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)