滚动表格视图时,重复显示uitableview单元的刻度按钮选择。并且tableview已经加载了item数组。但我需要在tableview中对单元格进行多重选择
-(void)checkButtonClicked:(UIButton *)sender{
CGPoint touchPoint = [sender convertPoint:CGPointZero toView:_tableView];
NSIndexPath *indexPath = [_tableView indexPathForRowAtPoint:touchPoint];
sender.tag = indexPath.row;
selectedIndexForPassing = sender.tag;
if([_selectionArray count ] == 0){
_uploadSheetBtn.enabled = NO;
if (sender.selected){
sender.selected = false;
}
else{
TCSTimeSheet * sc = self.timesheetList[selectedIndexForPassing];
_canEdit = sc.canEdit;
if([_canEdit isEqual: @"1"]){
sender.selected = true;
_uploadSheetBtn.enabled = YES;
TCSTimeSheet * sc = self.timesheetList[selectedIndexForPassing];
NSDictionary * detailsDictionary= [NSDictionary dictionaryWithObjectsAndKeys:sc.timesheetDetailId,@"timesheetDetailId",sc.scheduleEmployeeDetailId, @"scheduleDetailId",sc.lastUpdatedTime,@"lastUpdatedTime",sc.timesheetStatus,@"timesheetStatus",sc.shiftDate , @"shiftDate",sc.employeeId ,@"employeeId",nil];
[_storingArray addObject:detailsDictionary];
[_selectionArray addObject:sc.clientId];
}
}
}
单元将重用,但模型不会,视图状态应记录在模型中