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.让后让他选中

原文地址:https://www.cnblogs.com/Ninesday/p/5676607.html