project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m
branchhedgeroid
changeset 6328 d14adf1c7721
parent 6319 b57a37a94ad3
child 6658 2cccf6b2b89d
--- a/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m	Sat Nov 12 15:48:55 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SettingsContainerViewController.m	Sat Nov 12 17:06:49 2011 +0100
@@ -68,7 +68,6 @@
         self.baseController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
 
         [self.view addSubview:self.baseController.view];
-        // here setting activeController is not needed as the event is kept active by the uitabbarcontroller
     }
 
     [super viewDidLoad];
@@ -104,26 +103,31 @@
 
 
 #pragma mark -
-#pragma mark additional methods as we're using a UINavigationController programmatically
+#pragma mark view event management propagation
+// every time we add a uiviewcontroller programmatically we need to take care of propgating such messages
 // see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
 -(void) viewWillAppear:(BOOL)animated {
+    [self.activeController viewWillAppear:animated];
+    [self.baseController viewWillAppear:animated];
     [super viewWillAppear:animated];
-    [self.activeController viewWillAppear:animated];
 }
 
 -(void) viewWillDisappear:(BOOL)animated {
+    [self.activeController viewWillDisappear:animated];
+    [self.baseController viewWillDisappear:animated];
     [super viewWillDisappear:animated];
-    [self.activeController viewWillDisappear:animated];
 }
 
 -(void) viewDidAppear:(BOOL)animated {
+    [self.activeController viewDidAppear:animated];
+    [self.baseController viewDidAppear:animated];
     [super viewDidLoad];
-    [self.activeController viewDidAppear:animated];
 }
 
 -(void) viewDidDisappear:(BOOL)animated {
+    [self.activeController viewDidDisappear:animated];
+    [self.baseController viewDidDisappear:animated];
     [super viewDidUnload];
-    [self.activeController viewDidDisappear:animated];
 }