From bb4aaa68fa42fa102c0f86c6cdd6714e60eae6df Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Thu, 10 Nov 2011 11:47:28 -0600 Subject: [PATCH] Returning NSXMLParser as response object on all platforms, and documenting the change (Thanks to Zac Bowling for the suggestion) Don't set the responseParser delegate to nil in -dealloc --- AFNetworking/AFXMLRequestOperation.h | 4 ++++ AFNetworking/AFXMLRequestOperation.m | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/AFNetworking/AFXMLRequestOperation.h b/AFNetworking/AFXMLRequestOperation.h index 702fe2d..7fa919d 100644 --- a/AFNetworking/AFXMLRequestOperation.h +++ b/AFNetworking/AFXMLRequestOperation.h @@ -34,6 +34,10 @@ - `application/xml` - `text/xml` + + ## Use With AFHTTPClient + + When `AFXMLRequestOperation` is registered with `AFHTTPClient`, the response object in the success callback of `HTTPRequestOperationWithRequest:success:failure:` will be an instance of `NSXMLParser`. On platforms that support `NSXMLDocument`, you have the option to ignore the response object, and simply use the `responseXMLDocument` property of the operation argument of the callback. */ @interface AFXMLRequestOperation : AFHTTPRequestOperation { @private diff --git a/AFNetworking/AFXMLRequestOperation.m b/AFNetworking/AFXMLRequestOperation.m index 9a3407e..4570753 100644 --- a/AFNetworking/AFXMLRequestOperation.m +++ b/AFNetworking/AFXMLRequestOperation.m @@ -122,7 +122,6 @@ static dispatch_queue_t xml_request_operation_processing_queue() { } - (void)dealloc { - _responseXMLParser.delegate = nil; [_responseXMLParser release]; #if __MAC_OS_X_VERSION_MIN_REQUIRED @@ -189,15 +188,9 @@ static dispatch_queue_t xml_request_operation_processing_queue() { }); } } else { -#if __MAC_OS_X_VERSION_MIN_REQUIRED - if (success) { - success(self, self.responseXMLDocument); - } -#else if (success) { success(self, self.responseXMLParser); } -#endif } }; }