Permalink
Browse files

Made JSON parsing synchronous so it occurs before HTTPClient completi…

…onBlock executes

Because JSONReqOps dispatch to the json queue which dispatches back to the completion queue (or main) for the success block, while the HTTPClient's completionBlock just dispatches to main, the completionBlock could run before the individual successBlock. There's probably a better fix for this, but this will do for now. See how it performs.
  • Loading branch information...
1 parent 553e1d7 commit 30bf529c0029c611c88df3aced8ac8df07d96a79 @followben followben committed Mar 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 AFNetworking/AFJSONRequestOperation.m
@@ -130,7 +130,7 @@ - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operatio
});
}
} else {
- dispatch_async(json_request_operation_processing_queue(), ^(void) {
+ dispatch_sync(json_request_operation_processing_queue(), ^(void) {
id JSON = self.responseJSON;
if (self.JSONError) {

0 comments on commit 30bf529

Please sign in to comment.