【问题标题】:SDWebImage sending unknown exceptionSDWebImage 发送未知异常
【发布时间】: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


【解决方案1】:

我也遇到过。对我来说,这是由于没有在构建设置中添加 -ObjC 链接器标志造成的。添加标志的说明是here。祝你好运!

【讨论】:

    猜你喜欢
    • 2015-06-28
    • 1970-01-01
    • 2014-01-14
    • 2014-03-02
    • 1970-01-01
    • 2019-10-12
    • 2011-01-24
    • 1970-01-01
    • 2019-03-18
    相关资源
    最近更新 更多