Instance Method

perform(_:)

Asynchronously performs a given block on the context’s queue.

Declaration

func perform(_ block: @escaping () -> Void)

Parameters

block

The block to perform.

Discussion

You use this method to send messages to managed objects if the context was initialized using NSManagedObjectContextConcurrencyType.privateQueueConcurrencyType or NSManagedObjectContextConcurrencyType.mainQueueConcurrencyType.

This method encapsulates an autorelease pool and a call to processPendingChanges().

See Also

Performing Block Operations

func performAndWait(() -> Void)

Synchronously performs a given block on the context’s queue.