标签:
NSString *urlStr;
NSUrl *url = [NSURL URLWithString:urlStr];
//缓存图片
SDWebImageManager *manager = [SDWebImageManager sharedManager];
if (![manager diskImageExistsForURL:url]) {
[manager downloadWithURL:url options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) {
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) {
}];
}
//根据缓存地址读取图片
SDImageCache *imageCache = [SDImageCache sharedImageCache];
UIImage *image = [imageCache imageFromDiskCacheForKey:urlStr];
标签:
原文地址:http://www.cnblogs.com/llhlj/p/5103105.html