我检查了 NSBundle,但找不到 SDWebImage 保存图像的缓存。是否启用了缓存(请参见下面的代码)?根据Docs它进行缓存管理。
如文档中所述:
Just #import the UIImageView+WebCache.h header, and call the sd_setImageWithURL:placeholderImage: method from the tableView:cellForRowAtIndexPath: UITableViewDataSource method. Everything will be handled for you, from async downloads to caching management.
#import <SDWebImage/UIImageView+WebCache.h>
...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier] autorelease];
}
// Here we use the new provided sd_setImageWithURL: method to load the web image
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
cell.textLabel.text = @"My Text";
return cell;
}
最佳答案
在沙盒的 Library 文件夹中
您的应用程序 ID/Library/Caches/com.hackemist.SDWebImageCache.default/
关于ios - SDWebImage 的缓存在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36911992/