//如果有数据,选中第一行 if(tableDataSource.count > 0) { NSIndexPath *indextPath = [NSIndexPath indexPathForRow:0 inSection:0]; // 调用UItableViewDelegate [self tableView:self.selectDeptTable didSelectRowAtIndexPath:indextPath]; // 选中第一行 [self.tableView selectRowAtIndexPath:indextPath animated:YES scrollPosition:UITableViewScrollPositionNone]; }
原文:http://www.cnblogs.com/1oo1/p/3944406.html