iOS Objective-C - 在UITableView中选中带有复选标记的行,想要在更新上一行时显示所选的复选标记

时间:2016-07-04 10:30:59

标签: ios objective-c

我尝试了这个,但我没有得到它。这是我的代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:         (NSIndexPath *)indexPath
  {
NSArray *selectedRows=[tableView indexPathsForSelectedRows];
    NSMutableArray *rownumberArray=[[NSMutableArray alloc]init];
    NSMutableArray *dateArray=[[NSMutableArray alloc]init];

    for (int i=0; i<selectedRows.count; i++)
    {
        NSIndexPath *indexPath = [selectedRows objectAtIndex:i];
        NSInteger row = indexPath.row;
        NSNumber *number = [NSNumber numberWithInteger:row];
        [rownumberArray addObject:[HardDependency_IDArray objectAtIndex:indexPath.row]];
        [dateArray addObject:[endDateArray objectAtIndex:indexPath.row]];


        selectedRowArray=[[NSMutableArray alloc]init];
        dateArray2=[[NSMutableArray alloc]init];
        selectedRowArray=rownumberArray;
        dateArray2=dateArray;

 }

在更新UITableView单元格时,我无法看到以前选定的行..

0 个答案:

没有答案