UITableview accessory type disappear while scrolling

前端 未结 3 1554
情书的邮戳
情书的邮戳 2021-01-13 11:26

I have made a tableView in which i need to select multiple options. The options are selected but when i scroll the table view the check mark option get disappear and some ot

3条回答
  •  青春惊慌失措
    2021-01-13 12:09

    Check this example

    cell.accessoryType = UITableViewCellAccessoryNone;
     for (int x = 0; x < selectedIds.count; x++) {
         if ([[selectedIds objectAtIndex:x] isEqualToString:[[source objectAtIndex:[indexPath row]] objectForKey:@"id"]])
            cell.accessoryType = UITableViewCellAccessoryCheckmark;
     }
    

提交回复
热议问题