---
title: "obtainPermanentIDs(for:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsincrementalstore/obtainpermanentids(for:)"
---

# obtainPermanentIDs(for:)

Returns an array containing the object IDs for a given array of newly-inserted objects.

## Declaration

```swift
func obtainPermanentIDs(for array: [NSManagedObject]) throws -> [NSManagedObjectID]
```

## Parameters

- `array`: An array of newly-inserted objects.

## Return Value

Return Value An array containing the object IDs for the objects in array.

## Discussion

Discussion The returned array must return the object IDs in the same order as the objects appear in array. Discussion This method is called before execute(_:with:) with a save request, to assign permanent IDs to newly-inserted objects.

## See Also

### Manipulating Managed Objects

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