SDWebImage:setImageWithURL 在用于设置 UITableViewCell 的图像时失败 [英] SDWebImage : setImageWithURL fails when used to set image of a UITableViewCell

查看:26
本文介绍了SDWebImage:setImageWithURL 在用于设置 UITableViewCell 的图像时失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当调用 setImageWithURL 时,它失败了,

When call setImageWithURL, it fails with following,

[UIImageView setImageWithURL:placeholderImage:]:无法识别的选择器发送到实例 0x149a20 2011-12-14 18:11:38.060 [781:707]由于未捕获的异常而终止应用程序'NSInvalidArgumentException',原因:'-[UIImageViewsetImageWithURL:placeholderImage:]: 无法识别的选择器发送到实例 0x149a20'

我可以确认我已正确包含 SDWebImage 项目和所需的标头,因为我可以成功使用 SDWebImageManager.

I can confirm I have included SDWebImage project and required headers correctly as I can use the SDWebImageManager successfully.

以下是我调用 UIImageView 类别方法的代码 setImageWithURL

Following is the code where I called the UIImageView category method setImageWithURL

NSURL* url = [NSURL URLWithString:@"www.abc.com/abc.png"];
[cell.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"abc.png"]];    

推荐答案

我最终将所有 .h 和 .m 文件插入到我的项目中,然后它工作正常.当我只包含 .a 和 .h 文件时,我遇到了同样的错误.

I ended up inserting all the .h and .m files into my project and then it worked fine. I got the same error when I only included the .a and .h files.

这篇关于SDWebImage:setImageWithURL 在用于设置 UITableViewCell 的图像时失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆