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 5932435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:50:02+00:00 2026-05-22T14:50:02+00:00

I have a navigation controller that was setup via the project wizard. Currently when

  • 0

I have a navigation controller that was setup via the project wizard. Currently when the application is launched the navigation controller automatically gets created and displayed.

I now need to control the display of the navigation controller via code instead of via the .xib magic. How do I disable the automatic creation of the MainWindow.xib/RootViewController.xib? I confess I don’t actually know what’s going on and the relationship between MainWindow.xib and RootController.xib as the wizard set all this up.

Any references or code snippets on this would be helpful..
thanks!

  • 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-05-22T14:50:03+00:00Added an answer on May 22, 2026 at 2:50 pm

    To create the root navigation controller without a nib:

    In your App Delegate you should see the following:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // Override point for customization after application launch.
        // Add the navigation controller's view to the window and display.
    
        self.window.rootViewController = self.navigationController;
        [self.window makeKeyAndVisible];
        return YES;
    }

    self.navigationController refers to the navigation controller that was loaded from MainWindow.xib (the name of this file is specified in your app’s Info.plist file; see below).

    Open MainWindow.xib and disconnect the navigationController property of your App Delegate, then delete the Navigation Controller (not the Window) object in the Objects palette.

    Remove the IBOutlet property from the navigationController @property declaration in your App Delegate’s header file (since it will no longer be wired from a nib file).

    Replace the code in your App Delegate with something along the following lines:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        RootViewController *rootViewController = [[[RootViewController alloc] initWithNibName:nil bundle:nil] autorelease];
        self.navigationController = [[[UINavigationController alloc] initWithRootViewController:rootViewController] autorelease];
    
        self.window.rootViewController = self.navigationController;
        [self.window makeKeyAndVisible];
        return YES;
    }

    To create the main window without a nib:

    You probably don’t need to do this (and I don’t recommend it), but since you (sort of) asked…

    Delete MainWindow.xib.

    In main.m, replace the last argument to UIApplicationMain with the name of your App Delegate (with no extension). For instance:

    int retVal = UIApplicationMain(argc, argv, nil, @"TestProjectAppDelegate");

    Open your Info.plist file and delete the following two lines:

    <key>NSMainNibFile</key>
    <string>MainWindow</string>

    Remove the IBOutlet property from the window @property declaration in your App Delegate’s header file.

    Create the window in your App Delegate:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    
        // The rest stays the same...
    }
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a popover that gets loaded with a navigation controller, which displays the
I have an iPhone app that is based on a navigation controller. I have
I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have a core data application which uses a navigation controller to drill down
Here is the thing. I currently have a tabBar controller, with several navigation controllers
In my application I'm using a Navigation Controller to push one view that loads
I have a navigation system that provides a permalink for any link setup. When
I have a Navigation controller in my app that pushes my homeview on load.
I have several subviews that are controlled by a navigation controller. One of them
I have setup some views with the navigation controller. I want to be able

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.