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

# willRemoveCacheNodes(_:)

Method invoked before the store removes the given collection of cache nodes.

```
func willRemoveCacheNodes(_ cacheNodes: Set<NSAtomicStoreCacheNode>)
```

## Parameters

`cacheNodes`

The set of cache nodes to remove.

## Discussion

This method is invoked by the store before the call to [`save()`](/documentation/CoreData/NSAtomicStore/save()) with the collection of cache nodes marked as deleted by a managed object context.  You can override this method to track the nodes which will not be made persistent in the [`save()`](/documentation/CoreData/NSAtomicStore/save()) method.

You should not invoke this method directly in a subclass.

## See Also

[`-  save:`](/documentation/CoreData/NSAtomicStore/save())

Saves the cache nodes.



---

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)