Instance Method

obtainPermanentIDsForObjects:error:

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

Declaration

- (NSArray<NSManagedObjectID *> *)obtainPermanentIDsForObjects:(NSArray<NSManagedObject *> *)array error:(NSError * _Nullable *)error;

Parameters

array

An array of newly-inserted objects.

error

If an error occurs, upon return contains an NSError object that describes the problem.

Return Value

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

The returned array must return the object IDs in the same order as the objects appear in array.

Discussion

This method is called before executeRequest:withContext:error: with a save request, to assign permanent IDs to newly-inserted objects.

See Also

Manipulating Managed Objects

- executeRequest:withContext:error:

Returns a value as appropriate for the given request, or nil if the request cannot be completed.

- newValuesForObjectWithID:withContext:error:

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

- newValueForRelationship:forObjectWithID:withContext:error:

Returns the relationship for the given relationship of the object with a given object ID.

- newObjectIDForEntity:referenceObject:

Returns a new object ID that uses given data as the key.

- referenceObjectForObjectID:

Returns the reference data used to construct a given object ID.