|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Cocoa Threading||MBS MacFrameworks Plugin||8.0||Yes||No||No||Yes, macOS only||No|
Requires Mac OS X 10.5.
The NSOperation class manages the execution of a single encapsulated task. Operations are typically scheduled by adding them to an operation queue object (an instance of the NSOperationQueue class), although you can also execute them directly by explicitly invoking their start method.
Operation objects are single-shot objects, that is, they perform their task once. You cannot reuse the same NSOperation object to perform a task (or a slight variant of the task) multiple times in succession. Attempting to execute an operation that has already finished results in an exception.
When manually executing operations, you are responsible for making sure the object is ready to execute. Starting an operation that is not in the ready state generally results in an exception being thrown. If you use an operation queue to manage the execution, the NSOperationQueue object ensures that the operation is executed only when it is ready.
- 4 events
- 3 properties
- 18 methods
- method addDependency(op as NSOperationMBS)
- method cancel
- method Constructor
- method Constructor(Handle as Integer)
- method dependencies as NSOperationMBS()
- method dependenciesCount as Integer
- method dependency(index as Integer) as NSOperationMBS
- method isCancelled as boolean
- method isConcurrent as boolean
- method isExecuting as boolean
- method isFinished as boolean
- method isReady as boolean
- method Lock
- method main
- method removeDependency(op as NSOperationMBS)
- method start
- method Unlock
- method waitUntilFinished
- 5 constants
This class has no sub classes.
Some methods using this class:
- NSOperationQueueMBS.addOperation(op as NSOperationMBS)
- NSOperationQueueMBS.addOperations(ops() as NSOperationMBS, wait as boolean)
- NSOperationQueueMBS.operation(index as UInt32) as NSOperationMBS
- NSOperationQueueMBS.operations as NSOperationMBS()
Some examples which use this class:
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
MBS Xojo Plugins