---
title: "newValuesForObject(with:with:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsincrementalstore/newvaluesforobject(with:with:)"
---

# newValuesForObject(with:with:)

Returns an incremental store node encapsulating the persistent external values of the object with a given object ID.

## Declaration

```swift
func newValuesForObject(with objectID: NSManagedObjectID, with context: NSManagedObjectContext) throws -> NSIncrementalStoreNode
```

## Parameters

- `objectID`: The ID of the object for which values are requested.
- `context`: The managed object context into which values will be returned.

## Return Value

Return Value An incremental store node encapsulating the persistent external values of the object with object ID objectID, or nil if the corresponding object cannot be found.

## Discussion

Discussion The returned node should include all attributes values and may include to-one relationship values as instances of NSManagedObjectID. If an object with object ID objectID cannot be found, the method should return nil and—if error is not NULL—create and return an appropriate error object in error.

## See Also

### Manipulating Managed Objects

- [execute(_:with:)](coredata/nsincrementalstore/execute(_:with:).md)
- [newValue(forRelationship:forObjectWith:with:)](coredata/nsincrementalstore/newvalue(forrelationship:forobjectwith:with:).md)
- [obtainPermanentIDs(for:)](coredata/nsincrementalstore/obtainpermanentids(for:).md)
- [newObjectID(for:referenceObject:)](coredata/nsincrementalstore/newobjectid(for:referenceobject:).md)
- [referenceObject(for:)](coredata/nsincrementalstore/referenceobject(for:).md)
