codenamepenryn
codenamepenryn

Reputation: 461

viewWillAppear, viewDidAppear and viewWillDisappear not being called on iOS 5 when using setViewControllers

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

Upvotes: 2

Views: 1224

Answers (2)

codenamepenryn
codenamepenryn

Reputation: 461

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

Returning YES fixed the issue.

Upvotes: 1

Jacob Holman
Jacob Holman

Reputation: 76

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

[super viewDidLoad];

Upvotes: 0

Related Questions