<!--
{
  "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/newValuesForObject(with:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSIncrementalStore(im)newValuesForObjectWithID:withContext:error:"
  },
  "title" : "newValuesForObject(with:with:)"
}
-->

# newValuesForObject(with:with:)

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

```
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

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

The returned node should include all attributes values and may include to-one relationship values as instances of [`NSManagedObjectID`](/documentation/CoreData/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`.

---

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)