Whenever I pop a view controller manually, viewWillAppear
doesn't get called on the previous UIViewController
that now appears.
These are 2 regular UIViewControllers
. My application setup is like this:
- UINavigationController
- UITabViewController with 5 UIViewControllers including UIViewControllerA
-UIViewControllerA (When I get back here, viewWillAppear doesnt get called)
-UIViewControllerB (I'm here, I want to pop to A)
I've tried calling viewWillAppear
manually, but that doesn't help either. What could be wrong? My last resort will be popping B, and A, and then creating a new A, and pushing that, but that's only as a last resort(I assume this will work?)
It will not get called because the view is inside the navigation controller, but I found a solution here:
http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
Hope that helps.
You cannot have a
UITabBarController
"inside" of aUINavigationController
. That's probably why some of theviewWillAppear
methods aren't being called. Take a look here: Tab bar controller inside a navigation controller, or sharing a navigation root view