project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m
changeset 3659 f8d5ac50e307
parent 3548 4d220ee7c75f
child 3662 a44406f4369b
equal deleted inserted replaced
3658:113cb9345be1 3659:f8d5ac50e307
    14 @synthesize listOfSchemes;
    14 @synthesize listOfSchemes;
    15 
    15 
    16 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    16 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    17     return rotationManager(interfaceOrientation);
    17     return rotationManager(interfaceOrientation);
    18 }
    18 }
    19 
       
    20 
    19 
    21 #pragma mark -
    20 #pragma mark -
    22 #pragma mark View lifecycle
    21 #pragma mark View lifecycle
    23 -(void) viewDidLoad {
    22 -(void) viewDidLoad {
    24     [super viewDidLoad];
    23     [super viewDidLoad];
   125     
   124     
   126     NSInteger row = [indexPath row];
   125     NSInteger row = [indexPath row];
   127     NSString *selectedSchemeFile = [self.listOfSchemes objectAtIndex:row];
   126     NSString *selectedSchemeFile = [self.listOfSchemes objectAtIndex:row];
   128     
   127     
   129     // this must be set so childController can load the correct plist
   128     // this must be set so childController can load the correct plist
   130     childController.title = [selectedSchemeFile stringByDeletingPathExtension];
   129     childController.schemeName = [selectedSchemeFile stringByDeletingPathExtension];
   131     [childController.tableView setContentOffset:CGPointMake(0,0) animated:NO];
   130     [childController.tableView setContentOffset:CGPointMake(0,0) animated:NO];
   132 
   131 
   133     [self.navigationController pushViewController:childController animated:YES];
   132     [self.navigationController pushViewController:childController animated:YES];
   134 }
   133 }
   135 
   134 
   138 #pragma mark Memory management
   137 #pragma mark Memory management
   139 -(void)didReceiveMemoryWarning {
   138 -(void)didReceiveMemoryWarning {
   140     [super didReceiveMemoryWarning];
   139     [super didReceiveMemoryWarning];
   141     if (childController.view.superview == nil )
   140     if (childController.view.superview == nil )
   142         childController = nil;
   141         childController = nil;
       
   142     MSG_MEMCLEAN();
   143 }
   143 }
   144 
   144 
   145 -(void) viewDidUnload {
   145 -(void) viewDidUnload {
   146     self.listOfSchemes = nil;
   146     self.listOfSchemes = nil;
   147     childController = nil;
   147     childController = nil;
   149     MSG_DIDUNLOAD();
   149     MSG_DIDUNLOAD();
   150 }
   150 }
   151 
   151 
   152 
   152 
   153 -(void) dealloc {
   153 -(void) dealloc {
   154     [self.listOfSchemes release];
   154     [listOfSchemes release];
   155     [childController release];
   155     [childController release];
   156     [super dealloc];
   156     [super dealloc];
   157 }
   157 }
   158 
   158 
   159 
   159