Type Alias

dispatch_block_t

The prototype of blocks submitted to dispatch queues, which take no arguments and have no return value.

Declaration

typedef void (^dispatch_block_t)(void);

Discussion

Blocks behave like other Objective-C objects. Under ARC, the system releases and retains them automatically, and it converts them to malloc blocks as needed to facilitate their escape from the current scope of execution. When ARC is disabled, you are responsible for retaining and releasing blocks at appropriate times, and for copying blocks before allowing them to escape from the current scope of execution.

See Also

Executing Tasks Asynchronously

dispatch_async

Submits a block for asynchronous execution on a dispatch queue and returns immediately.

dispatch_async_f

Submits an application-defined function for asynchronous execution on a dispatch queue and returns immediately.

dispatch_after

Enqueues a block for execution at the specified time.

dispatch_after_f

Enqueues an application-defined function for execution at the specified time.

dispatch_function_t

The prototype of functions submitted to dispatch queues.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software