---
title: "newCacheNode(for:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsatomicstore/newcachenode(for:)"
---

# newCacheNode(for:)

Returns a new cache node for a given managed object.

## Declaration

```swift
func newCacheNode(for managedObject: NSManagedObject) -> NSAtomicStoreCacheNode
```

## Parameters

- `managedObject`: A managed object.

## Return Value

Return Value A new cache node for managedObject.

## Discussion

Discussion This method is invoked by the framework during a save operation, once for each newly-inserted managed object. It should pull information from the managed object and return a cache node containing the information (the node will be registered by the framework). Special Considerations You must override this method.

## See Also

### Updating Cache Nodes

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