【发布时间】:2013-08-23 10:30:50
【问题描述】:
我已经正确实现并安装了框架,这花了我几天时间,而且我也是新手,问题是我有这些来自网络的图像,所以我解析了它,然后想使用 SDImageView 加载这些图像,但之后编译我有这个异常
-[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x75b9730
[2456:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x75b9730'
当我删除占位符值时,会出现此异常
-[UIImageView setImageWithURL:]: unrecognized selector sent to instance 0x7555960
[2236:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:]: unrecognized selector sent to instance 0x7555960'
我的代码也是这样的:
NSString *imageLink = [currentData imageLinkFromWeb];
[cell.imageView setImageWithURL:[NSURL URLWithString:imageLink] placeholderImage:[UIImage imageNamed:@"image.jpg"]];
【问题讨论】:
-
您是否添加了
#import <SDWebImage/UIImageView+WebCache.h>?您是否收到构建警告?你怎么知道have implemented and installed the framework correctly什么时候崩溃了? -
看起来您在配置 SDWebImage 时遗漏了一些事情。缺少对 SDWebImage 的引用。
-
好吧,我在该页面上遵循了iosmadesimple.blogspot.com/2013/04/lazy-image-loading.html 的指示,并做了它所说的所有事情。但最后我有异常,是的,我还添加了#import
标签: ios objective-c exception sdwebimage