Instance Method

continueActivityUsingBlock:

Invokes the passed-in block to avoid a deadlock if performActivityWithSynchronousWaiting:usingBlock: is being invoked recursively.

Declaration

- (void)continueActivityUsingBlock:(void (^)(void))block;

Parameters

block

The block to be invoked.

Discussion

If a block that was passed to performActivityWithSynchronousWaiting:usingBlock: is being invoked, this method invokes the passed-in block, having recorded state that makes inner invocations of performActivityWithSynchronousWaiting:usingBlock: not wait. If this method is invoked outside of an invocation of a block passed to performActivityWithSynchronousWaiting:usingBlock:, this method simply invokes the passed-in block.

This method is useful when code executed in a block passed to performActivityWithSynchronousWaiting:usingBlock: may also invoke that method. For example, saveDocumentWithDelegate:didSaveSelector:contextInfo:, which uses performActivityWithSynchronousWaiting:usingBlock:, uses this around its invocation of runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo: or saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: because both of those methods also use performActivityWithSynchronousWaiting:usingBlock:. Without the use of this method the inner invocation of performActivityWithSynchronousWaiting:usingBlock: would wait forever.

See Also

Serialization

continueAsynchronousWorkOnMainThreadUsingBlock:

Invokes the passed-in block on the main thread.

performActivityWithSynchronousWaiting:usingBlock:

Waits for any work scheduled by previous invocations of this method to complete, then invokes the passed-in block.

performAsynchronousFileAccessUsingBlock:

Waits for any scheduled file access to complete but without blocking the main thread, then invokes the passed-in block.

performSynchronousFileAccessUsingBlock:

Waits for any scheduled file access to complete, then invokes the passed-in block.