Instance Method


Continues to perform the task for a user activity object using a different block.


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



The block to be invoked.


When AppKit calls performActivityWithSynchronousWaiting:usingBlock: recursively, it may execute this method with the specified block to avoid a deadlock.

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

Performing Tasks Serially

- performSynchronousFileAccessUsingBlock:

Waits for any scheduled file access 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.

- performActivityWithSynchronousWaiting:usingBlock:

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

- continueAsynchronousWorkOnMainThreadUsingBlock:

Invokes the passed-in block on the main thread.