Instance Method


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


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



An array of newly-inserted objects.


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.


This method is called before execute(_:with:) with a save request, to assign permanent IDs to newly-inserted objects.

See Also

Manipulating Managed Objects

func execute(NSPersistentStoreRequest, with: NSManagedObjectContext?) -> Any

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

func newValuesForObject(with: NSManagedObjectID, with: NSManagedObjectContext) -> NSIncrementalStoreNode

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

func newValue(forRelationship: NSRelationshipDescription, forObjectWith: NSManagedObjectID, with: NSManagedObjectContext?) -> Any

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

func referenceObject(for: NSManagedObjectID) -> Any

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