tableView里选中一行cell其它不选中的方法

方法1:

#pragma mark--选中状态

 

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    GASSelectNextTableViewCell *cell = (GASSelectNextTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];

    cell.selectedBtn.selected  = YES;

    

    }

-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {

    GASSelectNextTableViewCell *cell = (GASSelectNextTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];

    cell.selectedBtn.selected  = NO;

 

}

方法2:

1.定义一个全局的Button

2.让后让他选中

 

posted @ 2016-07-16 15:36  Ninesday  阅读(1126)  评论(0编辑  收藏  举报