编辑:我在这里找到了解决方案 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
我在编译和自动完成方面没有问题,我什至删除并重新添加了 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 时出了什么问题吗?有任何解决问题的想法吗?
最佳答案
这将解决问题:打开“Build Settings”选项卡,在“Linking”部分,找到“Other Linker Flags”设置并添加“-ObjC”标志:
关于iphone - 删除其他框架后得到无法识别的选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11945894/