ソースを参照

Merge pull request #3332 from duanhong169/master

Fixed issue where UIButton image downloading called wrong cancel method
Kevin Harwood 9 年 前
コミット
aba212c842

+ 1 - 0
AFNetworking/AFURLSessionManager.h

@@ -51,6 +51,7 @@
  - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`
  - `URLSession:task:didReceiveChallenge:completionHandler:`
  - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`
+ - `URLSession:task:needNewBodyStream:`
  - `URLSession:task:didCompleteWithError:`
 
  ### `NSURLSessionDataDelegate`

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

@@ -220,7 +220,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
         return;
     }
 
-    [self cancelImageDownloadTaskForState:state];
+    [self cancelBackgroundImageDownloadTaskForState:state];
 
     AFImageDownloader *downloader = [[self class] sharedImageDownloader];
     id <AFImageRequestCache> imageCache = downloader.imageCache;
@@ -253,7 +253,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
                            } else if(responseObject) {
                                [strongSelf setBackgroundImage:responseObject forState:state];
                            }
-                           [strongSelf af_setImageDownloadReceipt:nil forState:state];
+                           [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state];
                        }
 
                    }