如何在UItableView中预选择一行[重复]

问题描述

||                                                                                                                   这个问题已经在这里有了答案:                                                      

解决方法

您可以尝试selectRowAtIndexPath:animated:scrollPosition:。要传递IndexPath,可以使用:
[NSIndexPath indexPathForRow:depSelectedIndice inSection:0]
要么
[NSIndexPath indexPathForRow:comSelectedIndice inSection:0]
所以你们一起做:
[yourTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:depSelectedIndice inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone]