简体   繁体   English

SDWebImage链接问题

[英]SDWebImage linking issue

I am trying to use SDWebImage framework for asynchronous loading and caching images. 我正在尝试使用SDWebImage框架进行异步加载和缓存图像。 I could integrate SDWebImage project in to my project and build successfully. 我可以将SDWebImage项目集成到我的项目中并成功构建。 But I cannot use this line of code 但是我不能使用这一行代码

[pCell.imgViewThumb sd_setImageWithURL:[NSURL URLWithString:aPromo.picture_url_thumb] placeholderImage:[UIImage imageNamed:@"Placeholder.png"]];

It gives this error 它给出了这个错误

No visible @interface for 'UIImageView' declares the selector 'sd_setImageWithURL:placeholderImage:'

But the sd_setImageWithURL: method and the class already added in the project. 但是sd_setImageWithURL:方法和该类已添加到项目中。 I tried several times cleaning the project, re-linking the frameworks etc... But didn't work 我试过几次清理项目,重新链接框架等...但是没有用

在此处输入图片说明

在此处输入图片说明

You need to import the category. 您需要导入类别。 Type 类型

#import <SDWebImage/UIImageView+WebCache.h>

on top of the file. 在文件顶部。

Do you need to import the SDWebImage category file? 您是否需要导入SDWebImage类别文件? I believe it is called UIImageView+WebCache.h. 我相信它叫做UIImageView + WebCache.h。 The code would look like (at the top of your file with the other imports): 代码看起来像(在其他导入文件的顶部):

#import <SDWebImage/UIImageView+WebCache.h>

尝试导入导入“ SDWebImage / UIImageView + WebCache.h”

我使用此pod'SDWebImage','〜> 3.7.1'安装了最新的'SDWebImage'pod文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM