浏览代码

Update UIButton+AFNetworking.m

Added call to sharedImageCache to cache the responseObject.  Previously the method would be checking for a cached value, but would often not find a previous image because it was not being cached in this method.
johnbushnell 11 年之前
父节点
当前提交
fcd96d38e0
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      UIKit+AFNetworking/UIButton+AFNetworking.m

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

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