project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m
changeset 6319 b57a37a94ad3
parent 6078 8c0cc07731e5
child 6658 2cccf6b2b89d
equal deleted inserted replaced
6318:ca12368acc16 6319:b57a37a94ad3
    66         }
    66         }
    67         self.baseController.targetController = nil;
    67         self.baseController.targetController = nil;
    68         self.baseController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    68         self.baseController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    69 
    69 
    70         [self.view addSubview:self.baseController.view];
    70         [self.view addSubview:self.baseController.view];
    71         // here setting activeController is not needed as the event is kept active by the uitabbarcontroller
       
    72     }
    71     }
    73 
    72 
    74     [super viewDidLoad];
    73     [super viewDidLoad];
    75 }
    74 }
    76 
    75 
   102     [super dealloc];
   101     [super dealloc];
   103 }
   102 }
   104 
   103 
   105 
   104 
   106 #pragma mark -
   105 #pragma mark -
   107 #pragma mark additional methods as we're using a UINavigationController programmatically
   106 #pragma mark view event management propagation
       
   107 // every time we add a uiviewcontroller programmatically we need to take care of propgating such messages
   108 // see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
   108 // see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
   109 -(void) viewWillAppear:(BOOL)animated {
   109 -(void) viewWillAppear:(BOOL)animated {
       
   110     [self.activeController viewWillAppear:animated];
       
   111     [self.baseController viewWillAppear:animated];
   110     [super viewWillAppear:animated];
   112     [super viewWillAppear:animated];
   111     [self.activeController viewWillAppear:animated];
       
   112 }
   113 }
   113 
   114 
   114 -(void) viewWillDisappear:(BOOL)animated {
   115 -(void) viewWillDisappear:(BOOL)animated {
       
   116     [self.activeController viewWillDisappear:animated];
       
   117     [self.baseController viewWillDisappear:animated];
   115     [super viewWillDisappear:animated];
   118     [super viewWillDisappear:animated];
   116     [self.activeController viewWillDisappear:animated];
       
   117 }
   119 }
   118 
   120 
   119 -(void) viewDidAppear:(BOOL)animated {
   121 -(void) viewDidAppear:(BOOL)animated {
       
   122     [self.activeController viewDidAppear:animated];
       
   123     [self.baseController viewDidAppear:animated];
   120     [super viewDidLoad];
   124     [super viewDidLoad];
   121     [self.activeController viewDidAppear:animated];
       
   122 }
   125 }
   123 
   126 
   124 -(void) viewDidDisappear:(BOOL)animated {
   127 -(void) viewDidDisappear:(BOOL)animated {
       
   128     [self.activeController viewDidDisappear:animated];
       
   129     [self.baseController viewDidDisappear:animated];
   125     [super viewDidUnload];
   130     [super viewDidUnload];
   126     [self.activeController viewDidDisappear:animated];
       
   127 }
   131 }
   128 
   132 
   129 
   133 
   130 @end
   134 @end