Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSOperationQueueMBS class.

NSOperationQueueMBS.addOperation(op as NSOperationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Adds the specified operation object to the operation queue.

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 these conditions is true.

Once added, the specified operation remains in the queue until it is executed or cancelled.

Please setup dependencies before you add the operation to a queue. Once the operation is in the queue it may be executed directly.

NSOperationQueueMBS.addOperations(ops() as NSOperationMBS, wait as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Adds the specified array of operations to the queue.

ops: The array of NSOperation objects that you want to add to the receiver.
wait: If true, the current thread is blocked until all of the specified operations finish executing. If false, the operations are added to the queue and control returns immediately to the caller.

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 it its isFinished method returns true.

Available in Mac OS X v10.6 and later.

NSOperationQueueMBS.areAllOperationsFinished as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns whether all operations have been finished.

True if all operations have finished.

Some examples using this method:

NSOperationQueueMBS.cancelAllOperations

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Cancels all queued and executing operations.

This method sends a cancel message to all operations currently in the queue or executing. Queued operations are cancelled before they begin executing. If an operation is already executing, it is up to that operation to recognize the cancellation and stop what it is doing.

NSOperationQueueMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The constructor creating a new operation queue.

On success the handle property is not 0.

NSOperationQueueMBS.isOneOperationExecuting as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Whether at least one operation is still executing.

True if one of the operations is executing.
False if no operation is executing.

NSOperationQueueMBS.isSuspended as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
A Boolean value indicating whether the receiver is scheduling queued operations for execution.

True if operations are being scheduled for execution; otherwise, false.
(Read and Write computed property)

NSOperationQueueMBS.maxConcurrentOperationCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The maximum number of concurrent operations that the queue can execute.

(Read and Write computed property)

NSOperationQueueMBS.name as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Threading MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The name of this queue.

The default value of this string is "NSOperationQueue <id>", where <id> is the memory address of the operation queue. If you want to know when a queue's name changes, configure a KVO observer to observe the name key path of the operation queue.
Available in Mac OS X v10.6 and later.
(Read and Write computed property)

NSOperationQueueMBS.operation(index as UInt32) as NSOperationMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a noperations currently in the queue at the given index.

You can use this method to access the operations queued at any given moment. Operations remain queued until they finish their task. Therefore, the returned array may contain operations that are either executing or waiting to be executed.

Available in Mac OS X v10.5 and later.

NSOperationQueueMBS.operationCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the number of operations currently in the queue.

The value returned by this method reflects the instantaneous number of objects in the queue and changes as operations are completed. As a result, by the time you use the returned value, the actual number of operations may be different. You should therefore use this value only for approximate guidance and should not rely on it for object enumerations or other precise calculations.

Available in Mac OS X v10.6 and later.

NSOperationQueueMBS.operations as NSOperationMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The operations currently in the queue.

NSOperationQueueMBS.waitUntilAllOperationsAreFinished

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Threading MBS MacFrameworks Plugin 8.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Blocks the current thread until all of the receiver's queued and executing operations finish executing.

When called, this method blocks the current thread and waits for the receiver's current and pending operations to finish executing. While the thread is blocked, the receiver continues to launch already queued operations and monitor those that are executing. During this time, the current thread cannot add operations to the queue, but other threads may. Once all of the pending operations are finished, this method returns.

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...