Fixing AFImageRequestOperation to use [self alloc] instead of explicit class in class method in order to preserve behavior in subclasses

Signed-off-by: Mattt Thompson <m@mattt.me>
This commit is contained in:
James Clarke 2013-04-06 12:11:29 +02:00 committed by Mattt Thompson
parent 566a40f469
commit ab00b9559c

View file

@ -75,7 +75,7 @@ static dispatch_queue_t image_request_operation_processing_queue() {
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
{
AFImageRequestOperation *requestOperation = [[AFImageRequestOperation alloc] initWithRequest:urlRequest];
AFImageRequestOperation *requestOperation = [(AFImageRequestOperation *)[self alloc] initWithRequest:urlRequest];
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
if (success) {
UIImage *image = responseObject;
@ -106,7 +106,7 @@ static dispatch_queue_t image_request_operation_processing_queue() {
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSImage *image))success
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
{
AFImageRequestOperation *requestOperation = [[AFImageRequestOperation alloc] initWithRequest:urlRequest];
AFImageRequestOperation *requestOperation = [(AFImageRequestOperation *)[self alloc] initWithRequest:urlRequest];
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
if (success) {
NSImage *image = responseObject;