Browse Source

UIButton+AFNetworking. The methods that asynchronously download images have started to properly report on the failures.

Maxim Zabelin 10 years ago
parent
commit
8644f90b82
1 changed files with 2 additions and 2 deletions
  1. 2 2
      UIKit+AFNetworking/UIButton+AFNetworking.m

+ 2 - 2
UIKit+AFNetworking/UIButton+AFNetworking.m

@@ -199,7 +199,7 @@ static const char * af_backgroundImageRequestOperationKeyForState(UIControlState
             }
             }
             [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
             [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
         } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
-            if ([[urlRequest URL] isEqual:[operation.response URL]]) {
+            if ([[urlRequest URL] isEqual:[operation.request URL]]) {
                 if (failure) {
                 if (failure) {
                     failure(error);
                     failure(error);
                 }
                 }
@@ -265,7 +265,7 @@ static const char * af_backgroundImageRequestOperationKeyForState(UIControlState
             }
             }
             [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
             [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
         } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
-            if ([[urlRequest URL] isEqual:[operation.response URL]]) {
+            if ([[urlRequest URL] isEqual:[operation.request URL]]) {
                 if (failure) {
                 if (failure) {
                     failure(error);
                     failure(error);
                 }
                 }