Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
fcd96d38e0
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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) {