Instance Method

addDependency:

Makes the receiver dependent on the completion of the specified operation.

Declaration

- (void)addDependency:(NSOperation *)op;

Parameters

operation

The operation on which the receiver should depend. The same dependency should not be added more than once to the receiver, and the results of doing so are undefined.

Discussion

The receiver is not considered ready to execute until all of its dependent operations have finished executing. If the receiver is already executing its task, adding dependencies has no practical effect. This method may change the isReady and dependencies properties of the receiver.

It is a programmer error to create any circular dependencies among a set of operations. Doing so can cause a deadlock among the operations and may freeze your program.

See Also

Managing Dependencies

removeDependency:

Removes the receiver’s dependence on the specified operation.

dependencies

An array of the operation objects that must finish executing before the current object can begin executing.