Explorar o código

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

Taichiro Yoshida %!s(int64=12) %!d(string=hai) anos
pai
achega
e65c83bd36
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;
     __weak __typeof(self)weakSelf = self;
     self.af_backgroundImageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
     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) {
     [self.af_backgroundImageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
         __strong __typeof(weakSelf)strongSelf = weakSelf;
         __strong __typeof(weakSelf)strongSelf = weakSelf;
         if ([[urlRequest URL] isEqual:[operation.request URL]]) {
         if ([[urlRequest URL] isEqual:[operation.request URL]]) {