_selectedIndex = [NSIndexPath indexPathForRow:0 inSection:0];
self.tableview selectRowAtIndexPath:_selectedIndex animated:YES scrollPosition:UITableViewScrollPositionTop];
注意:以上代码要在tableview加载完之后再调用,要确保有数据后才能调用,不然会数组越界
_selectedIndex = [NSIndexPath indexPathForRow:0 inSection:0];
self.tableview selectRowAtIndexPath:_selectedIndex animated:YES scrollPosition:UITableViewScrollPositionTop];
注意:以上代码要在tableview加载完之后再调用,要确保有数据后才能调用,不然会数组越界