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;
    }

最佳答案

在沙盒的库文件夹中

您的应用程序 ID/Library/Caches/com.hackemist.SDWebImageCache.default/

关于ios - SDWebImage 的缓存在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36911992/

相关文章:

android - 如何在webview android中启用缓存

ios - 在 Swift 中使用 UIActivityIndi​​cator-for-SDWebImage

ios - 正确屏蔽 CALayers

java - 如何在我的 WEB 应用程序中启用 infinispan 缓存?

ios - 如何将 40000 条记录快速插入 iPad 中的 sqlite 数据库

android - 在 android 中 2 天后使 UIL 缓存图像过期

ios - 如何在 swift 中添加 SDWebImagePrefetcher

ios - 我应该更喜欢哪种图像加载方法?

iphone - iOS - UITableView 部分标题内的 UILabel + UIActivityIndi​​catorView

objective-c - 自定义垂直 UISlider 的问题