8
我想在tableView中选择一个单元格。它正在使用此代码正常工作,但一旦以编程方式选择,它不会触发didSelectRowAtIndexPath
事件。我如何触发它?以编程方式选择行时未触发didSelectRowAtIndexPath事件
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.mainTable selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
工作,感谢您的帮助 – Jaume 2012-01-02 22:36:05
对于未来的旅客:这就是为什么这不起作用很好的解释,但我相信这是一个比较全面的解决方案:http://stackoverflow.com/questions/2305781/iphone-didselectrowatindexpath-not-invoked – kbpontius 2015-06-17 17:40:18