The execution priority of the operation in an operation queue.
- iOS 2.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
This property contains the relative priority of the operation. This value is used to influence the order in which operations are dequeued and executed. The returned value always corresponds to one of the predefined constants. (For a list of valid values, see
NSOperation.) If no priority is explicitly set, this method returns
You should use priority values only as needed to classify the relative priority of non-dependent operations. Priority values should not be used to implement dependency management among different operation objects. If you need to establish dependencies between operations, use the
add method instead.
If you attempt to specify a priority value that does not match one of the defined constants, the operation object automatically adjusts the value you specify towards the
NSOperation priority, stopping at the first valid constant value. For example, if you specified the value -10, the operation would adjust that value to match the
NSOperation constant. Similarly, if you specified +10, this operation would adjust the value to match the