UITableView默认选中第一行

//如果有数据,选中第一行
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];
    }

  

posted @ 2014-08-29 10:43  1oo1  阅读(421)  评论(0编辑  收藏  举报