I use this AFNetworking method to start multiple requests at once:
- (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations
progressBlock:(void (^)(NSUInteger numberOfCompletedOperations, NSUInteger totalNumberOfOperations))progressBlock
completionBlock:(void (^)(NSArray *operations))completionBlock
One of them is a AFJSONRequestOperation
. The problem is that the success-block of this JSON operation is executed after the completion-block of the batch. The reason is: AFJSONRequestOperation
has an internal dispatch queue for JSON processing. So the JSON data is still in processing while the completion block is called.
Question: How can execute code in the completion block after the success block of the JSON operation has been called?
I tried to dispatch a code block on the main queue but that didn't help.