kevinrenskers / SDWebImage-ProgressView

Category on UIImageView, adding a progress view while images are downloaded using SDWebImage.
MIT License
140 stars 24 forks source link

CRASH "unrecognized selector sent to instance" #1

Closed dzenbot closed 11 years ago

dzenbot commented 11 years ago

I'm having troubles making this work. It's odd, it used to work well, but I'm not receiving this "unrecognized selector sent to instance" message.

I have properly imported the category class (installed via cocoa-pods).

import "UIImageView+ProgressView.h"

Now, running [self respondsToSelector:@selector(setImageWithURL:placeholderImage:options:usingProgressView:)] returns NO.

Any ideas?

kevinrenskers commented 11 years ago

Uhm no idea, just created a test project and it works just fine.

#import <SDWebImage-ProgressView/UIImageView+ProgressView.h>
#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end

@implementation ViewController

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [self.imageView setImageWithURL:[NSURL URLWithString:@"http://lorempixel.com/950/950"] placeholderImage:nil options:0 usingProgressView:nil];
}

@end
kevinrenskers commented 11 years ago

Hm could this be your problem? [self respondsToSelector] instead of self.imageview? For me this returns YES:

NSLog(@"%i", [self.imageView respondsToSelector:@selector(setImageWithURL:placeholderImage:options:usingProgressView:)]);
dzenbot commented 11 years ago

I also created a sample project, and it did work.

So it was obviously my code, but it took me several hours of testing to figure out that the pod lib wasn't rightly compiled. After doing lots of cleaning, I decided to re-install all pod dependencies and everything worked out!!

This is the first time I had issues with a non-well installed/compiled pod, I really don't know what happened.

Sorry for wasting your time, and again, thank you for such great add-on and patience ;)

kevinrenskers commented 11 years ago

No problem at all, good to know it wasn't a problem in my code :)