ソースを参照

修复设置YYWebImageOptionIgnoreDiskCache参数无效的问题

梁树元 8 年 前
コミット
b90d245b64
1 ファイル変更2 行追加1 行削除
  1. 2 1
      YYWebImage/YYWebImageOperation.m

+ 2 - 1
YYWebImage/YYWebImageOperation.m

@@ -423,7 +423,8 @@ static void URLInBlackListAdd(NSURL *url) {
                 if (image || (_options & YYWebImageOptionRefreshImageCache)) {
                     NSData *data = _data;
                     dispatch_async([YYWebImageOperation _imageQueue], ^{
-                        [_cache setImage:image imageData:data forKey:_cacheKey withType:YYImageCacheTypeAll];
+                        YYImageCacheType cacheType = (_options & YYWebImageOptionIgnoreDiskCache) ? YYImageCacheTypeMemory : YYImageCacheTypeAll;
+                        [_cache setImage:image imageData:data forKey:_cacheKey withType:cacheType];
                     });
                 }
             }