<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSIncrementalStore/managedObjectContextDidUnregisterObjects(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSIncrementalStore(im)managedObjectContextDidUnregisterObjectsWithIDs:"
  },
  "title" : "managedObjectContextDidUnregisterObjects(with:)"
}
-->

# managedObjectContextDidUnregisterObjects(with:)

Indicates that objects identified by a given array of object IDs are no longer being used by a managed object context.

```
func managedObjectContextDidUnregisterObjects(with objectIDs: [NSManagedObjectID])
```

## Parameters

`objectIDs`

An array of object IDs.

## Discussion

This method is the counterpart to [`managedObjectContextDidRegisterObjects(with:)`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidRegisterObjects(with:)).

Passing an object ID in the object IDs array of [`managedObjectContextDidRegisterObjects(with:)`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidRegisterObjects(with:)) is akin to incrementing the object ID’s reference count by 1; passing an object ID in the object IDs array of [`managedObjectContextDidUnregisterObjects(with:)`](/documentation/CoreData/NSIncrementalStore/managedObjectContextDidUnregisterObjects(with:)) is akin to decrementing the object ID’s reference count by 1. It is only when an object ID’s reference count is 0 that no contexts indicate that they are using the corresponding managed object. (Object IDs start with a reference count of 0.)

For example, if the register methods is invoked on two occasions when the object IDs array contains a given object ID, and the unregister method is invoked once when the object IDs array contains that object ID, then a context is still using the object with the given ID.

---

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)