我正在尝试使用SDWebImage框架进行异步加载和缓存图像。 我可以将SDWebImage项目集成到我的项目中并成功构建。但我不能使用这行代码
[pCell.imgViewThumb sd_setImageWithURL:[NSURL URLWithString:aPromo.picture_url_thumb] placeholderImage:[UIImage imageNamed:@"Placeholder.png"]];
它给出了这个错误
No visible @interface for 'UIImageView' declares the selector 'sd_setImageWithURL:placeholderImage:'
但 sd_setImageWithURL:方法和已在项目中添加的类。我多次尝试清理项目,重新链接框架等... 但是没有工作
答案 0 :(得分:0)
您需要导入类别。输入
#import <SDWebImage/UIImageView+WebCache.h>
在文件顶部。
答案 1 :(得分:0)
您是否需要导入SDWebImage类别文件?我相信它被称为UIImageView + WebCache.h。代码看起来像(在文件的顶部与其他导入):
#import <SDWebImage/UIImageView+WebCache.h>
答案 2 :(得分:0)
尝试导入导入&#34; SDWebImage / UIImageView + WebCache.h&#34;
答案 3 :(得分:0)
我安装了最新的SDWebImage&#39; pod文件使用这个 pod&#39; SDWebImage&#39;,&#39;〜&gt; 3.7.1&#39; 问题已修复