Instance Method

addOperations:waitUntilFinished:

Adds the specified operations to the queue.

Declaration

- (void)addOperations:(NSArray<NSOperation *> *)ops waitUntilFinished:(BOOL)wait;

Parameters

ops

The operations to be added to the queue.

wait

If YES, the current thread is blocked until all of the specified operations finish executing. If NO, the operations are added to the queue and control returns immediately to the caller.

Discussion

An operation object can be in at most one operation queue at a time and cannot be added if it is currently executing or finished. This method throws an NSInvalidArgumentException exception if any of those error conditions are true for any of the operations in the ops parameter.

Once added, the specified operation remains in the queue until its finished method returns YES.

See Also

Managing Operations in the Queue

- addOperation:

Adds the specified operation to the receiver.

- addOperationWithBlock:

Wraps the specified block in an operation and adds it to the receiver.

operations

The operations currently in the queue.

Deprecated
operationCount

The number of operations currently in the queue.

Deprecated
- cancelAllOperations

Cancels all queued and executing operations.

- waitUntilAllOperationsAreFinished

Blocks the current thread until all of the receiver’s queued and executing operations finish executing.

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