Эх сурвалжийг харах

[Issue #1448] Adding missing image serializer for background request operation

Mattt Thompson 12 жил өмнө
parent
commit
a25b1d30dd

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

@@ -152,6 +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 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]]) {