Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7803015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:26:08+00:00 2026-06-02T01:26:08+00:00

I have a UITabBarController that hosts 5 UINavigationControllers (let’s call them N1 – N5).

  • 0

I have a UITabBarController that hosts 5 UINavigationControllers (let’s call them N1 – N5). Each of the UINavigationControllers has UI elements that cause a UITableViewController to be pushed onto the navigation stack (I use MonoTouch.Dialog DialogViewController to implement these UITableViewControllers). Let’s call those T1 – T5.

When I navigate between the tabs, the ViewDidAppear method gets called on each of N1 – N5 as expected. But when I touch a UI element on, say, N1, that causes T1 to get pushed onto the nav stack, and then try to go back using the back button, N1’s ViewDidAppear method doesn’t get called.

The funny thing is that if I “tab over” to a different tab (say N2) and then “tab back” to N1, the ViewDidAppear will be called as normal. And even if I have T1 pushed onto the nav stack, if I do the same tabbing around, N1’s ViewDidAppear will still be called.

The MonoTouch code for N1 looks like this:

public class CalendarPage : UINavigationController
{
    private DialogViewController dvc;

    public override void ViewDidAppear (bool animated)
    {           
        // initialize controls
        var now = DateTime.Today;
        var root = new RootElement("Calendar")
        {
            from it in App.ViewModel.Items
                where it.Due != null && it.Due >= now
                orderby it.Due ascending
                group it by it.Due into g
                select new Section (((DateTime) g.Key).ToString("d")) 
                {
                    from hs in g
                        select (Element) new StringElement (((DateTime) hs.Due).ToString("d"),
                            delegate 
                            {
                                ItemPage itemPage = new ItemPage(this, hs);
                                itemPage.PushViewController();
                            })
                        { 
                            Value = hs.Name
                        }                                                    
                }
        };

        if (dvc == null)
        {
            // create and push the dialog view onto the nav stack
            dvc = new DialogViewController(UITableViewStyle.Plain, root);
            dvc.NavigationItem.HidesBackButton = true;  
            dvc.Title = NSBundle.MainBundle.LocalizedString ("Calendar", "Calendar");
            this.PushViewController(dvc, false);
        }
        else
        {
            // refresh the dialog view controller with the new root
            var oldroot = dvc.Root;
            dvc.Root = root;
            oldroot.Dispose();
            dvc.ReloadData();
        }
        base.ViewDidAppear (animated);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:26:10+00:00Added an answer on June 2, 2026 at 1:26 am

    I figured out what was going on. When the back button is pressed on the inner DialogViewController (created in ItemPage), the outer DialogViewController (“T1” above) is now the first responder, NOT the UINavigationController (“N1”). My confusion stemmed from the fact that I turned the back button off on that outer DialogViewController so I was assuming I had popped out all the way to the UINavigationController (N1), whereas I was still in a DialogViewController (T1).

    I implemented the desired behavior (refreshing the contents of “T1”) by creating a ViewDissapearing event on the inner DialogViewController (ItemPage in this case) and checking whether I am popping out – and if so, invoking the parent controller’s ViewDidAppear method.

            actionsViewController.ViewDissapearing += (sender, e) => 
            {
                if (actionsViewController.IsMovingFromParentViewController)
                    controller.ViewDidAppear(false);
            };
    

    Note the funny thing about this code is that the property that actually works is IsMovingFromParentViewController, NOT IsMovingToParentViewController (which is intuitively what you’d think would be set when you’re navigating back). I imagine this may be a bug in MT.Dialog, but something that can’t be fixed for back-compact reasons.

    I hope this ends up helping someone…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITabBarController that has 3 tabs. Each tab contains a UITableViewController. When
I have an application that has a UITabBarController with two tabs, each having its
HEllo, I have a hybrid iPhone application that has a UITabBarController and 5 Tabs.
I have a UITabBarController that loads a UINavigationController for each of its tab. The
Quick problem: I have an UITabBarController with 2 navigation controllers [lets call them Left
I have an application that uses a UITabBarController as its outer container. Each tab
I have a root UIViewController subclass that has a UITabBar, (I'm not using UITabBarController)
I have a UITabBarController setup with 2 UINavigationControllers. One UINavigationController has One UIViewController, the
I have an app with a UITabBarController that manages some UINavigationControllers, which in turn
I have a UITabBarController, and each tab handles a different UIViewController that pushes on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.