Contents

execute(_:with:)

Executes the specified request on each of the coordinator’s persistent stores.

Declaration

func execute(_ request: NSPersistentStoreRequest, with context: NSManagedObjectContext) throws -> Any

Parameters

  • request:

    A fetch or save request.

  • context:

    The context against which request should be executed.

Return Value

An array containing managed objects, managed object IDs, or dictionaries as appropriate for a fetch request; an empty array if request is a save request, or nil if an error occurred.

Discussion

User defined requests return arrays of arrays, where a nested array is the result returned from a single store.

See Also

Performing tasks