2
votes

I'm setting a ViewController using the following code: [detailNav setViewControllers:[NSArray arrayWithObject:vc] animated:NO];

When the ViewController is set in iOS 6 and 7, viewWillAppear, viewDidAppear and viewWillDisappear is called.

However, in iOS 5, these methods are not called.

Edit: pushViewController does not work either: viewWillDisappear and viewDidDisappear never get called

2
did you make certain to set the delegate of those view controllers you are adding?Michael Dautermann
Post some more code. I am rather certain UINavigationController does call these methods.Léo Natan

2 Answers

1
votes

Turns out somewhere in the ViewControllers hierarchy, automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers was returning NO.

Returning YES fixed the issue.

0
votes

Shot in the dark but make sure each has the super call example in the viewdidload method it would have this first

[super viewDidLoad];