project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
changeset 3548 4d220ee7c75f
parent 3547 02875b1145b7
child 3619 1155d8970646
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Wed Jun 23 22:03:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Thu Jun 24 01:08:25 2010 +0200
@@ -23,6 +23,9 @@
 
     CGSize screenSize = [[UIScreen mainScreen] bounds].size;
     self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
+    
+    self.selectedScheme = @"";
+    self.selectedWeapon = @"";
 }
 
 -(void) viewWillAppear:(BOOL) animated {
@@ -31,12 +34,15 @@
     NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL];
     self.listOfSchemes = contentsOfDir;
     
+    if ([listOfSchemes containsObject:@"Default.plist"])
+         self.selectedScheme = @"Default.plist";
+    
     contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL];
     self.listOfWeapons = contentsOfDir;
-    
-    self.selectedScheme = @"Default.plist";
-    self.selectedWeapon = @"Default.plist";
-    
+         
+    if ([listOfWeapons containsObject:@"Default.plist"])
+         self.selectedWeapon = @"Default.plist";
+
     [self.tableView reloadData];
 }