0

I am trying to use SDWebImage framework for asynchronous loading and caching images. I could integrate SDWebImage project in to my project and build successfully. 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. I tried several times cleaning the project, re-linking the frameworks etc... But didn't work

enter image description here

enter image description here

smartsanja
  • 4,413
  • 9
  • 58
  • 106

4 Answers4

1

I installed the latest 'SDWebImage' pod file using this pod 'SDWebImage', '~>3.7.1' Issue fixed

smartsanja
  • 4,413
  • 9
  • 58
  • 106
0

You need to import the category. Type

#import <SDWebImage/UIImageView+WebCache.h>

on top of the file.

ZeMoon
  • 20,054
  • 5
  • 57
  • 98
  • Where have you imported the category? It needs to be in the same file you are calling the `sd_setImageWithURL:placeholderImage:` method – ZeMoon Mar 12 '15 at 15:27
  • Yes. I have done it correctly. I'll update the code in the question – smartsanja Mar 12 '15 at 15:29
0

Do you need to import the SDWebImage category file? I believe it is called UIImageView+WebCache.h. The code would look like (at the top of your file with the other imports):

#import <SDWebImage/UIImageView+WebCache.h>
0

Try to import import "SDWebImage/UIImageView+WebCache.h"

Dipen Patel
  • 911
  • 2
  • 9
  • 22