【问题标题】:Using SDWebImage to iphone使用 SDWebImage 到 iPhone
【发布时间】:2013-07-08 14:46:38
【问题描述】:

我正在为我的应用程序使用 SDWebImage。

我从这里下载了 ASWebImage 文件 link

添加到 myapp.然后我导入了 UIImageView+WebCache.h

当我运行我的应用程序时,我遇到了异常。

这是我的代码

self.view.backgroundColor = [UIColor whiteColor];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]
[imageView setImageWithURL:[NSURL URLWithString:@"http://mydomain.com/a.jpg"]];
[self.view addSubview:imageView];
[imageView release];

当我运行这个应用程序时,我遇到了以下异常。

[UIImageView setImageWithURL:]: unrecognized selector sent to instance 0x6e64390
2012-08-23 19:32:14.828 test123[16941:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:]: unrecognized selector sent to instance 0x6e64390'

【问题讨论】:

    标签: iphone uiimageview sdwebimage


    【解决方案1】:

    确保您已导入“ImageIO.framework”

    【讨论】:

      【解决方案2】:

      为了解决这个问题,请参考项目安装说明。我遇到了同样的错误,但是按照安装说明进行操作后,问题立即得到解决。

      您可以在此处找到这些说明:https://github.com/rs/SDWebImage#installation

      【讨论】:

        【解决方案3】:

        您是否已将 SDWebImage 库与您的应用相关联?链接器标志 -ObjC 怎么样?

        【讨论】:

        • 没有。我没有链接。你能告诉我如何添加链接器标志吗?
        • 在您的项目设置中找到“Build Phases”部分,然后查找 Link Binary with Libraries 部分以确保您已将库添加到构建中。然后检查“构建设置”选项卡并将-ObjC 添加到其他链接器标志字段。
        • 基本上,确保您遵循了自述文件安装部分中的所有步骤 - github.com/rs/SDWebImage#installation
        猜你喜欢
        • 2016-05-04
        • 2023-04-06
        • 1970-01-01
        • 2014-11-19
        • 2015-01-08
        • 2012-08-09
        • 1970-01-01
        • 2017-10-30
        • 2012-10-13
        相关资源
        最近更新 更多