ios - 如何手动调用UITableView的delegate方法?

标签 ios objective-c uitableview

我有一个按钮应该调用tableview的委托(delegate)方法

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

点击该按钮时。

谁能告诉我怎么做。

最佳答案

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0];
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
[self tableView:self.tableView didSelectRowAtIndexPath:indexPath];

关于ios - 如何手动调用UITableView的delegate方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19813127/

相关文章:

ios - 删除/停止 dispatch_async iOS

ios - NSFetchedResultsController 未按预期获取

iphone - UITableView 重新加载完成后是否有可能获得回调?

ios - UITableViewController 和 ViewWillAppear 问题

ios - 无法获取 tableView 中的单元格数量

ios - 如何使用 Parse 从 pfobject 获取 pffile

ios - 将 Objective-C 中的类标记为在特定 iOS 版本中已弃用并包含一条消息

ios - 从 SKScene 呈现 UIViewController

objective-c - 在 Objective-C 中获取方法的返回类型的方法?

ios - 两个私有(private)队列上下文之间的 mergeChangesFromContextDidSaveNotification