直接从SDWebImage的缓存中取图片

#import "SDWebImageManager.h"
#import "SDImageCache.h"


NSString* strUrl = @"http://xxx.com/x.jpg";
SDWebImageManager *manager = [SDWebImageManager sharedManager];
NSString* key = [manager cacheKeyForURL:[NSURL URLWithString:strUrl]];
SDImageCache* cache = [SDImageCache sharedImageCache];
//此方法会先从memory中取。
image = [cache imageFromDiskCacheForKey:key];

你可能感兴趣的:(iPhone)