From 436fbe82d1c115161cf66b3f627c8af85b46885d Mon Sep 17 00:00:00 2001 From: Evan Long Date: Mon, 17 Oct 2011 14:20:31 -0700 Subject: [PATCH] AFJSONRequestOperation.m: -Fixing an issue where all JSON parse errors are ignored. The operation.error was always being set to nil no what responseJSON set the error property to. AFXMLRequestOperation.m: -Making sure the success callback for the iOS case is run on the main thread --- AFNetworking/AFJSONRequestOperation.m | 2 -- AFNetworking/AFXMLRequestOperation.m | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AFNetworking/AFJSONRequestOperation.m b/AFNetworking/AFJSONRequestOperation.m index e12e2dc..a4e56d2 100644 --- a/AFNetworking/AFJSONRequestOperation.m +++ b/AFNetworking/AFJSONRequestOperation.m @@ -65,9 +65,7 @@ static dispatch_queue_t json_request_operation_processing_queue() { } } else { dispatch_async(json_request_operation_processing_queue(), ^(void) { - NSError *error = nil; id JSON = operation.responseJSON; - operation.error = error; dispatch_async(dispatch_get_main_queue(), ^(void) { if (operation.error) { diff --git a/AFNetworking/AFXMLRequestOperation.m b/AFNetworking/AFXMLRequestOperation.m index f2aec27..26ff4b1 100644 --- a/AFNetworking/AFXMLRequestOperation.m +++ b/AFNetworking/AFXMLRequestOperation.m @@ -70,7 +70,9 @@ static dispatch_queue_t xml_request_operation_processing_queue() { } else { NSXMLParser *XMLParser = operation.responseXMLParser; if (success) { - success(operation.request, operation.response, XMLParser); + dispatch_async(dispatch_get_main_queue(), ^(void) { + success(operation.request, operation.response, XMLParser); + }); } } };