I have a tableView. If I click on a cell, it starts loading the file with the UIActivityIndicator animation. After the download is complete, a check mark appears (the file exists) and the user can proceed to the next controller. It is necessary that after the transition and return back all the checkboxes are gone. How to do it?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: [NSString stringWithFormat:@"Cell%d", indexPath.row] forIndexPath:indexPath]; if (indexPath.row == 1){ if (!fileExists) { [_spinner startAnimating]; } if (fileExists) { cell.accessoryView = nil; cell.accessoryType = UITableViewCellAccessoryCheckmark; } } if (indexPath.row == 2){ if (!fileExists1) { [_spinner1 startAnimating]; } if (fileExists1) { cell.accessoryView = nil; cell.accessoryType = UITableViewCellAccessoryCheckmark; } } } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 1) { if (!fileExists) { _spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; _spinner.frame = CGRectMake(0, 0, 24, 24); UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryView = _spinner; tableView cellForRowAtIndexPath:indexPath].accessoryView = _spinner; [_spinner startAnimating]; if (fileExists) { [tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark; } } } }