---
title: "willRemoveCacheNodes(_:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsatomicstore/willremovecachenodes(_:)"
---

# willRemoveCacheNodes(_:)

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

## Declaration

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

## Parameters

- `cacheNodes`: The set of cache nodes to remove.

## Discussion

Discussion This method is invoked by the store before the call to 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() method. You should not invoke this method directly in a subclass.

## See Also

### Related Documentation

- [save()](coredata/nsatomicstore/save().md)

### Updating Cache Nodes

- [newCacheNode(for:)](coredata/nsatomicstore/newcachenode(for:).md)
- [newReferenceObject(for:)](coredata/nsatomicstore/newreferenceobject(for:).md)
- [updateCacheNode(_:from:)](coredata/nsatomicstore/updatecachenode(_:from:).md)
