--- a/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m Fri Nov 12 23:59:40 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m Sat Nov 13 01:24:39 2010 +0100
@@ -85,12 +85,14 @@
createTeamNamed([fileName stringByDeletingPathExtension]);
[self.listOfTeams addObject:fileName];
- [fileName release];
// order the array alphabetically, so teams will keep their position
[self.listOfTeams sortUsingSelector:@selector(compare:)];
+ [self.tableView reloadData];
- [self.tableView reloadData];
+ NSInteger index = [self.listOfTeams indexOfObject:fileName];
+ [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
+ [fileName release];
}
#pragma mark -