tableView默认选中第一行并响应点击事件

//若是有数据,默认选中第一行并请求第一行的数据    spa

        if(self.tableViewData.count>0)    orm

        {    it

           [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop];//设置选中第一行(默认有蓝色背景)    io

           [self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]];//实现点击第一行所调用的方法    table

      }

   select

相关文章
相关标签/搜索