0
我開始與iOS開發,我想要在表視圖中實現以下行爲: 列表元素1不能被選中,當選擇其他行時,列表成爲所選的一個。我知道是無意義的,它只是一個練習。順便說我的代碼是:更改表視圖的選擇
-(NSIndexPath *) tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSUInteger row =[indexPath row];
if (row==0){
return nil;
}
return indexPath;
}
它爲被選中避免行0,現在我需要選擇的元素來改變以前的當行!= 0。我該怎麼做?