I’m using MonoTouch. When I push a new controller onto the stack of a UINavigationController, it works fine. When I hit the back button, NO events fire, even though visually, the view is popped off the stack. Specifically, I want to use ViewDidDisappear and ViewDidAppear to do some stuff:
SurveyEditor editor = new SurveyEditor(surveyInstance);
NavigationController.PushViewController(editor, true);
then in SurveyEditor:
public override void ViewWillDisappear (bool animated)
{
Console.WriteLine("SurveyEditor ViewWillDisappear");
base.ViewWillDisappear (animated);
}
public override void ViewDidDisappear (bool animated)
{
Console.WriteLine("SurveyEditor ViewDidDisappear");
base.ViewDidDisappear (animated);
}
None of these are being called, and in my root view, ViewDidAppear is also not getting called! Starting to lose my mind on this one.
If you launch the nav controller from the view Controller using the following, it does get called:
(sorry this is not MonoTouch – I encountered the problem in the regular Objective-C. This was my solution.)
Look at Dustin Clark’s comment here.