【发布时间】:2012-12-15 10:49:51
【问题描述】:
我在我的 iPhone 项目中使用SDWebImage 来自动加载和缓存图像。基本用法完美:
[self.imageView setImageWithURL:[NSURL URLWithString:*url*]];
但是当我使用带有额外参数选项的任何其他方法时,例如我想使用的带有完成块的方法:
[self.posterImageView setImageWithURL:[NSURL URLWithString:[Utils getMoviePosterUrlForMovie:movie withSize:PosterSizeBig]]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) { }];
我得到错误:
'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:completed:]: unrecognized selector sent to instance
我发现的与无法识别的选择器错误有关的所有其他问题和解决方案都是整个库的问题,其中基本的“setImageWithURL”方法也不起作用。
这可能是什么问题?谢谢!
【问题讨论】:
-
您是否在文件中包含 UIImageView+WebCache.m 以针对您的目标进行编译?
标签: ios automatic-ref-counting objective-c-blocks unrecognized-selector sdwebimage