I used a cell tapped method with check button. If I select the first section and first row then it automatically selects the second section first row. Meaning if you select any row then it is selecting the same row in another section. I don't understand why.
I also tried section condition ( indexpath.section ==0
) or something another section condition. I have two arrays so I take manually 2 section and row will depend on the condition.
if(section ==0) { return arra1.count } else { return arr2.count }
Previously I followed this implementation.
Finally resolve my problem. i just take two indexset array. if checkbutton tap by first section than i store addindex in nsmutable indexset arr1 and same thing for second section after that i check condition
if ([self.arr1 containsIndex: indexPath.row]) {
[self.arr1 removeIndex: indexPath.row];
} else {
[self.arr1 addIndex:indexPath.row];
}
[_tblVScene reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
if ([self.arr2 containsIndex: indexPath.row]) {
[self.arr2 removeIndex: indexPath.row];
} else {
[self.arr2 addIndex:indexPath.row];
}
[_tblVScene reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.