All of my view controllers extend my own BaseViewController : UIViewController, and in this i have overridden
- (BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {
return NO;
}
However, iOS 5 simulator has decided to ignore this and continues to call my viewWillAppear etc methods on my nested UIViewController hierarchy.
I've done the same in another project and it worked fine. Is there something else i'm missing to get it to listen to me?
Turns out you also have to use this method too:
UIViewController addChildViewController
So by doing this:
[self addChildViewController:_browserViewController];
[browserView addSubview:_browserViewController.view];
[_browserViewController didMoveToParentViewController:self];
..and returning NO from automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers
... it stops the view lifecycle methods being called twice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With