So, I am using the addOperationWithBlock^{}
method of the NSOperationQueue and I want to put the fine grained isCancelled
property check at points in the operation code. How do I get the instance of the operation that will run while in this block?
For example, this is my code snippet:
[operationQueueInstance addOperationWithBlock:^{
if (!???.isCancelled){
NSlog(@"Instruction 1");
}
if (!???.isCancelled){
NSlog(@"Instruction 2");
}
NSlog(@"Instruction 3");
}];
How do I get the instance of the operation this block would run in so that I can evaluate the isCancelled
property for the instructions?
TIA