dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSURL *url=[NSURL URLWithString:share.profilePicUrl];
[_imageview setImageWithURLRequest:[NSURLRequest requestWithURL:url] placeholderImage:
[UIImage imageNamed:@""] success:^(NSURLRequest *request,NSHTTPURLResponse *response,UIImage *image)
{
dispatch_async(dispatch_get_main_queue(), ^{
_imageview.image = image;
});
} failure:^(NSURLRequest *request,NSHTTPURLResponse *response,NSError *error){
}];
});
的UIImageView setImageWithURLRequest:placeholderImage:成功:失敗:]: 無法識別的選擇發送到實例0xb1b71f0在AfNetworking不能識別功能名稱
二○一三年十二月一十二日23:41:00.826的應用[6749: 1403] *終止應用程序由於 未捕獲的異常 'NSInvalidArgumentException',原因: ' - [的UIImageView setImageWithURLRequest:placeholderImage:成功:失敗:]: 無法識別的選擇發送到實例0xb1b71f0'
你確定你有存儲在_imageView一個UIImageView? –
你能提供一些關於你的設置的更多信息嗎? _imageView是UIImageView的一個實例,並且您是否包含AFNetworking提供的UIImageView + AFNetworking類別,其中_imageView可以採用setImageWithURLRequest:placeholderImage:success:failure方法? – ramzyo
您是否將AFNetworking添加爲Cocoa Pod或AFNetworking.framework?在任何情況下,確保在複製階段添加二進制文件(.a或.framework) –