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
This commit is contained in:
Evan Long 2011-10-17 14:20:31 -07:00
parent 3040aafee9
commit 436fbe82d1
2 changed files with 3 additions and 3 deletions

View file

@ -65,9 +65,7 @@ static dispatch_queue_t json_request_operation_processing_queue() {
} }
} else { } else {
dispatch_async(json_request_operation_processing_queue(), ^(void) { dispatch_async(json_request_operation_processing_queue(), ^(void) {
NSError *error = nil;
id JSON = operation.responseJSON; id JSON = operation.responseJSON;
operation.error = error;
dispatch_async(dispatch_get_main_queue(), ^(void) { dispatch_async(dispatch_get_main_queue(), ^(void) {
if (operation.error) { if (operation.error) {

View file

@ -70,7 +70,9 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
} else { } else {
NSXMLParser *XMLParser = operation.responseXMLParser; NSXMLParser *XMLParser = operation.responseXMLParser;
if (success) { if (success) {
dispatch_async(dispatch_get_main_queue(), ^(void) {
success(operation.request, operation.response, XMLParser); success(operation.request, operation.response, XMLParser);
});
} }
} }
}; };