Ios SDWebImage的缓存在哪里?
我检查了NSBundle,但找不到SDWebImage保存图像的缓存。缓存是否已启用(请参见下面的代码)?根据缓存管理,它进行缓存管理 如文件所示: 只需导入UIImageView+WebCache.h头,并调用 sd_setImageWithURL:Placeholder图像:来自 tableView:cellForRowAtIndexPath:UITableViewDataSource方法。 从异步下载到缓存,一切都将为您处理 管理Ios SDWebImage的缓存在哪里?,ios,caching,sdwebimage,Ios,Caching,Sdwebimage,我检查了NSBundle,但找不到SDWebImage保存图像的缓存。缓存是否已启用(请参见下面的代码)?根据缓存管理,它进行缓存管理 如文件所示: 只需导入UIImageView+WebCache.h头,并调用 sd_setImageWithURL:Placeholder图像:来自 tableView:cellForRowAtIndexPath:UITableViewDataSource方法。 从异步下载到缓存,一切都将为您处理 管理 #导入 ... -(UITableViewCell*)ta
#导入
...
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{
静态NSString*MyIdentifier=@“MyIdentifier”;
UITableViewCell*单元格=[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
如果(单元格==nil){
单元格=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier]自动释放];
}
//这里,我们使用新提供的sd_setImageWithURL:方法来加载web映像
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:@”http://www.domain.com/path/to/image.jpg"]
占位符图像:[UIImage ImageName:@“placeholder.png”];
cell.textlab.text=@“我的文本”;
返回单元;
}
在沙盒的库文件夹中
沙盒库文件夹中的应用程序ID/Library/Caches/com.hackemist.SDWebImageCache.default/
您的应用程序ID/Library/Caches/com.hackemist.SDWebImageCache.default/在项目的代码行下方搜索
\u diskCachePath
是SDWebImage
的缓存
if (![_fileManager fileExistsAtPath:_diskCachePath]) {
[_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL];
}
在项目中的代码行下方搜索\u diskCachePath
是SDWebImage
的缓存
if (![_fileManager fileExistsAtPath:_diskCachePath]) {
[_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL];
}