2012-08-14 97 views
1

编辑后获取无法识别的选择:我发现这里的解决方案SDWebImage : setImageWithURL fails when used to set image of a UITableViewCell删除其他框架

我的影片利用SDWebImage的UITableView和它的工作很好,但我决定从我的应用程序中删除ShareKit。我相信我所做的只是删除ShareKit,删除对它的任何引用,然后重新安装ObjectiveFlickr,JSONKit和LFWebAPIkit。所有这些我都没有在这张表中使用。在我这样做之后,除了这个tableview之外,一切都正常。

,我得到这个错误:

-[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x86b31a0 

有我没有问题汇编,并与自动完成,我甚至删除,readdded SDWebImage但它不会做任何事情。一切都正常运行,但是当它试图用的UIImageView加载该表是在这一行立即崩溃:

[cell.imageView setImageWithURL:[v thumbURL] placeholderImage:[UIImage imageNamed:@"46-movie-2.png"]]; 

这里是我的代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
static NSString *CellIdentifier = @"YTVVideoTableCell"; 

YTVVideoTableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 

if (cell == nil) { 
    cell = [[YTVVideoTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
} 

Video *v = [[[VideoStore sharedStore] allItems] objectAtIndex:[indexPath row]];; 

[cell.imageView setImageWithURL:[v thumbURL] placeholderImage:[UIImage imageNamed:@"46-movie-2.png"]]; 

[cell setController:self]; 
[cell setTableView:[self tableView]]; 

[[cell titleLabel] setText:[v title]]; 
[[cell titleLabel] alignBottom]; 

return cell; 

}

的什么地方出了错任何想法当我删除ShareKit?任何想法如何排除故障?

+0

可能重复[SDWebImage:setImageWithURL失败时,用于设置图像的UITableViewCell](http://stackoverflow.com/questions/8504953/sdwebimage-setimagewithurl-fails-when-used-to-set-image-of -a-的UITableViewCell) – 2012-08-14 05:25:10

回答

0

检查您是否已将SDWebImage标头导入到班级中。

2

这将解决这个问题:打开“生成设置”选项卡,在“链接”部分中,找到“其他链接器标记”的设置,并添加“-ObjC”标志: enter image description here

0

我通过Cocoapods使用SDWebImage时出现此错误。事实证明,SDWebImage pod被列在Podfile中不正确的目标下。将它移动到文件顶部对我来说很合适。