0
我开始与iOS开发,我想要在表视图中实现以下行为: 列表元素1不能被选中,当选择其他行时,列表成为所选的一个。我知道是无意义的,它只是一个练习。顺便说我的代码是:更改表视图的选择
-(NSIndexPath *) tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSUInteger row =[indexPath row];
if (row==0){
return nil;
}
return indexPath;
}
它为被选中避免行0,现在我需要选择的元素来改变以前的当行!= 0。我该怎么做?