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