Instance Property

operations

The operations currently in the queue.

Declaration

@property(readonly, copy) NSArray<__kindof NSOperation *> *operations;

Discussion

The array in this property contains zero or more NSOperation objects in the order in which they were added to the queue. This order does not necessarily reflect the order in which those operations will be executed.

You can use this property to access the operations queued at any given moment. Operations remain queued until they finish their task. Therefore, the array may contain operations that are executing or waiting to be executed. The list may also contain operations that were executing when the array was initially retrieved but have subsequently finished.

You may monitor changes to the value of this property using Key-value observing. Configure an observer to monitor the operations key path of the operation queue.

See Also

Managing Operations in the Queue

- addOperation:

Adds the specified operation to the receiver.

- addOperations:waitUntilFinished:

Adds the specified operations to the queue.

- addOperationWithBlock:

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

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