ios - SDWebImage 的缓存在哪里?

标签 ios caching sdwebimage

我检查了 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/

相关文章:

php - 获取项目列表的更好方法 : cached serialized data vs database queries or other?

python - Django cache_page 检查

iphone - 使用 Objective-C 在 ios 文件系统上创建链接

ios - 使用千位分隔符格式化 Int64

ios - 在 Ubuntu 上生成 ipa 文件 ios

ios - NSFileHandle fileHandleForWriting 返回 nil,错误代码 24

caching - azure 共享缓存和新的 azure redis 缓存有什么区别?

iphone - 如何使用iPhone SDK从网址中仅获取文本的特定部分?

ios - 在 Objective-C(iOS) 的模态序列中实现 SDWebImage

ios - 如何快速添加SDWebImagePrefetcher