# HG changeset patch # User antonc27 # Date 1446000060 -3600 # Node ID 7f3f96e9fdf1550ab8d8600587ce04350330af57 # Parent 5c21ee975d5d66f766298cf6e85811d4c82cd1de - Fix for crash while deleting >=2 saved games Note: SavedGamesViewController certainly needs refactoring diff -r 5c21ee975d5d -r 7f3f96e9fdf1 project_files/HedgewarsMobile/Classes/SavedGamesViewController.m --- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Tue Oct 27 21:11:44 2015 +0100 +++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Wed Oct 28 03:41:00 2015 +0100 @@ -127,6 +127,7 @@ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; editableCell.delegate = self; } + editableCell.tag = [indexPath row]; editableCell.respectEditing = YES; editableCell.textField.text = [[self.listOfSavegames objectAtIndex:[indexPath row]] stringByDeletingPathExtension]; editableCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; @@ -157,7 +158,8 @@ } -(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - [(EditableCellView *)[self.tableView cellForRowAtIndexPath:indexPath] save:nil]; + [((EditableCellView *)[self.tableView cellForRowAtIndexPath:indexPath]).textField resignFirstResponder]; + self.numberOfItems--; [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];