Instance Property

cancelled

A Boolean value indicating whether the operation has been cancelled

Declaration

@property(readonly, getter=isCancelled) BOOL cancelled;

Discussion

The default value of this property is NO. Calling the cancel method of this object sets the value of this property to YES. Once canceled, an operation must move to the finished state.

Canceling an operation does not actively stop the receiver’s code from executing. An operation object is responsible for calling this method periodically and stopping itself if the method returns YES.

You should always check the value of this property before doing any work towards accomplishing the operation’s task, which typically means checking it at the beginning of your custom main method. It is possible for an operation to be cancelled before it begins executing or at any time while it is executing. Therefore, checking the value at the beginning of your main method (and periodically throughout that method) lets you exit as quickly as possible when an operation is cancelled.

See Also

Getting the Operation Status

executing

A Boolean value indicating whether the operation is currently executing.

finished

A Boolean value indicating whether the operation has finished executing its task.

concurrent

A Boolean value indicating whether the operation executes its task asynchronously.

asynchronous

A Boolean value indicating whether the operation executes its task asynchronously.

ready

A Boolean value indicating whether the operation can be performed now.

name

The name of the operation.