I'm trying to add checkmarks to items when the user select rows in a table view. However, the view is not refreshed and the checkmarks do no show up:
- (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell* oldCell = [self tableView:tv cellForRowAtIndexPath:[NSIndexPath indexPathForRow:selectedIndex inSection:0]];
oldCell.accessoryType = UITableViewCellAccessoryNone;
if (indexPath.section == 0) {
selectedIndex = indexPath.row;
}
UITableViewCell* newCell = [self tableView:tv cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
[tv deselectRowAtIndexPath:indexPath animated:NO];
}
What could be a reason for that?