iphone - 删除其他框架后得到无法识别的选择器

标签 iphone objective-c ios uitableview

编辑:我在这里找到了解决方案 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”标志: enter image description here

关于iphone - 删除其他框架后得到无法识别的选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11945894/

相关文章:

iphone - UINavigationController 中的 UITableView

iphone - UIPickerView pickerView :viewForRow:forComponent:reusingView: does not affect below iOS 5. 0

ios - 警告 : Attempt to present <UIViewController: 0x74acff0> on <ViewController: 0x82b25a0> whose view is not in the window hierarchy

iphone - 用于构建通用应用程序的最新资源/教程?

iphone - 应用程序进入后台状态时如何取消 AVExportSession?

iphone - 如何使用 Obj C 检测 iPhone 与 iPhone 3G

iphone - 苹果是否在每个图标上应用应用程序图标光泽效果和圆角?

objective-c - 在 macOS 应用程序中,我有一个后台线程执行一行代码,需要花费大量时间。如何取消封禁?

iphone - UIScrollview 类似动画的分页

ios - tableView 实现就像 appStore 上一样