i need to put asynchronous operations into an operation queue, however, they need to execute on after the other
self.operationQueue = [NSOperationQueue new];
What I did was playing with [myQueue setSuspended:YES] and [myQueue setSuspended:NO] before and after respectively.
For example:
[myQueue addOperationWithBlock:^{
[myQueue setSuspended:YES];
[someBackendService doSomeAsyncJobWithCompletionBlock:^{
callback(YES, nil);
[myQueue setSuspended:NO];
});
}];
The achieved effect is that the queue is suspended before the async task, therefore even though the operation block is returned, it only starts the next operation (subject to maxConcurrentOperationCount of course) when the async task's completion block is called.