Permalink
Browse files

Returning NSXMLParser as response object on all platforms, and docume…

…nting the change (Thanks to Zac Bowling for the suggestion)

Don't set the responseParser delegate to nil in -dealloc
  • Loading branch information...
mattt committed Nov 10, 2011
1 parent 67a4538 commit bb4aaa68fa42fa102c0f86c6cdd6714e60eae6df
Showing with 4 additions and 7 deletions.
  1. +4 −0 AFNetworking/AFXMLRequestOperation.h
  2. +0 −7 AFNetworking/AFXMLRequestOperation.m
@@ -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
@@ -122,7 +122,6 @@ - (id)initWithRequest:(NSURLRequest *)urlRequest {
}
- (void)dealloc {
- _responseXMLParser.delegate = nil;
[_responseXMLParser release];
#if __MAC_OS_X_VERSION_MIN_REQUIRED
@@ -189,15 +188,9 @@ - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operatio
});
}
} else {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED
- if (success) {
- success(self, self.responseXMLDocument);
- }
-#else
if (success) {
success(self, self.responseXMLParser);
}
-#endif
}
};
}

0 comments on commit bb4aaa6

Please sign in to comment.