- Fix for crash while deleting >=2 saved games ios-revival
authorantonc27 <antonc27@mail.ru>
Wed, 28 Oct 2015 03:41:00 +0100
branchios-revival
changeset 11250 7f3f96e9fdf1
parent 11247 5c21ee975d5d
child 11252 3dc674af7662
- Fix for crash while deleting >=2 saved games Note: SavedGamesViewController certainly needs refactoring
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];