21 -(void) viewDidLoad { |
21 -(void) viewDidLoad { |
22 [super viewDidLoad]; |
22 [super viewDidLoad]; |
23 |
23 |
24 CGSize screenSize = [[UIScreen mainScreen] bounds].size; |
24 CGSize screenSize = [[UIScreen mainScreen] bounds].size; |
25 self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44); |
25 self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44); |
|
26 |
|
27 self.selectedScheme = @""; |
|
28 self.selectedWeapon = @""; |
26 } |
29 } |
27 |
30 |
28 -(void) viewWillAppear:(BOOL) animated { |
31 -(void) viewWillAppear:(BOOL) animated { |
29 [super viewWillAppear:animated]; |
32 [super viewWillAppear:animated]; |
30 |
33 |
31 NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL]; |
34 NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL]; |
32 self.listOfSchemes = contentsOfDir; |
35 self.listOfSchemes = contentsOfDir; |
33 |
36 |
|
37 if ([listOfSchemes containsObject:@"Default.plist"]) |
|
38 self.selectedScheme = @"Default.plist"; |
|
39 |
34 contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL]; |
40 contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL]; |
35 self.listOfWeapons = contentsOfDir; |
41 self.listOfWeapons = contentsOfDir; |
36 |
42 |
37 self.selectedScheme = @"Default.plist"; |
43 if ([listOfWeapons containsObject:@"Default.plist"]) |
38 self.selectedWeapon = @"Default.plist"; |
44 self.selectedWeapon = @"Default.plist"; |
39 |
45 |
40 [self.tableView reloadData]; |
46 [self.tableView reloadData]; |
41 } |
47 } |
42 |
48 |
43 |
49 |
44 |
50 |