I tried AFHTTPRequestOperation
objects combined with other NSOperation
objects placed into a queue. But now I know that in AFHTTPRequestOperation
only requests are performed in correct order (not response processing blocks).
I don't need the correct order of requests but I need to handle their responses in a correct order and send a "success" notification at the end. If one of the steps is failed then cancel the sequence. The only idea I have is the following:
NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
//synchronous request1
...
//handle request1 response
...
//synchronous request2
...
//handle request2 response
...
//send notification about success or failure
...
}];
It looks crazy but correct. Is this code correct? Could you advice anything better?