瀏覽代碼

fix to setBackgroundImageForState works correctly. It causes response serializer is set to af_imageRequestOperation instead of af_backgroundImageRequestOperation.

Taichiro Yoshida 12 年之前
父節點
當前提交
e65c83bd36
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      UIKit+AFNetworking/UIButton+AFNetworking.m

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

@@ -152,7 +152,7 @@ static char kAFBackgroundImageRequestOperationKey;
 
     __weak __typeof(self)weakSelf = self;
     self.af_backgroundImageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
-    self.af_imageRequestOperation.responseSerializer = [AFImageResponseSerializer serializer];
+    self.af_backgroundImageRequestOperation.responseSerializer = [AFImageResponseSerializer serializer];
     [self.af_backgroundImageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
         __strong __typeof(weakSelf)strongSelf = weakSelf;
         if ([[urlRequest URL] isEqual:[operation.request URL]]) {