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

  • SEARCH
  • Home
  • 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 8842451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:57:43+00:00 2026-06-14T10:57:43+00:00

I have a rootcontroller pushed on a UINavigationController . Inside that rootcontroller class, I

  • 0

I have a rootcontroller pushed on a UINavigationController.
Inside that rootcontroller class, I can access the UINavigationController with this.NavigationController

However, this rootcontroller has a ScrollView and I’m adding subcontrollers (or more precise, the View of this subcontroller) to this ScrollView.

I would now like to access the UINavigationController from inside such subcontroller.
Following properties are all null

        this.NavigationController
        this.ParentViewController
        this.PresentedViewController
        this.PresentingViewController

It seems in ObjectiveC you can use following code

YourAppDelegate *del = (YourAppDelegate *)[UIApplication sharedApplication].delegate;
[del.navigationController pushViewController:nextViewController animated:YES];

Unfortunately, i don’t know how to map this to C# in MonoTouch.
I tried the following, but it’s not working:

UIApplication.SharedApplication.KeyWindow.RootViewController.NavigationController

I know I could pass the UINavigationController object to all my classes (parameter in constructor), but that’s probably not the cleanest way to go.

  • 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-14T10:57:44+00:00Added an answer on June 14, 2026 at 10:57 am

    To extend poupou’s answer, here is an example of what I usually do in my AppDelegate class:

    Add a static property of the AppDelegate itself:

    public static AppDelegate Self { get; private set; }
    

    Add my root navigation controller as a property:

    public UINavigationController MainNavController { get; private set; }
    

    In FinishedLaunching:

    Self = this;
    window = new UIWindow(UIScreen.MainScreen.Bounds);
    this.MainNavController = new UINavigationController(); // pass the nav controller's root controller in the constructor
    window.RootViewController = this.MainNavController;
    // ..
    

    This way, I can access the root view controller from anywhere, like this:

    AppDelegate.Self.MainNavController.PushViewController(someViewController);
    

    … instead of having to write this all the time:

    AppDelegate myAppDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate;
    myAppDelegate.MainNavController.PushViewController(someViewController);
    

    Plus, I can directly access all other AppDelegate‘s properties I might have.

    Hope this helps.

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

Sidebar

Related Questions

have written this little class, which generates a UUID every time an object of
HEllo, I have a hybrid iPhone application that has a UITabBarController and 5 Tabs.
I've got a simple example where i have a delegate that has a string,
I have a very simple application that has only 2 view controllers. The initial
I have View Controller with a (navigation controller) that can flip between 2 views
I have a rootController and 5 contentControllers, each as its own class. I want
I have a navigationController in MainMenuViewController class. When I push FirstViewController in navigationController I
I have root view that presents navigation controller with content controller, this is how
I have been seeing this issue and resolving it by manually creating UINavigationController in
Have deployed numerous report parts which reference the same view however one of them

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.