project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m
changeset 4287 7dbdc862097c
parent 4281 e033cf015b2c
child 4976 088d40d8aba2
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Fri Nov 12 23:59:40 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Sat Nov 13 01:24:39 2010 +0100
@@ -81,12 +81,14 @@
     createSchemeNamed([fileName stringByDeletingPathExtension]);
 
     [self.listOfSchemes addObject:fileName];
-    [fileName release];
 
     // order the array alphabetically, so schemes will keep their position
     [self.listOfSchemes sortUsingSelector:@selector(compare:)];
+    [self.tableView reloadData];
 
-    [self.tableView reloadData];
+    NSInteger index = [self.listOfSchemes indexOfObject:fileName];
+    [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
+    [fileName release];
 }
 
 #pragma mark -