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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:55:08+00:00 2026-05-25T14:55:08+00:00

This was pretty easy in Xcode 3. But I’m totally lost in Xcode 4.*

  • 0

This was pretty easy in Xcode 3. But I’m totally lost in Xcode 4.* It looks like IB is not used at all. And all the TabBarController code is in code.

Question: How do I add a NavigationBarController to the default code that Xcode generates when using a TabBarController template?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];

UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];

self.tabBarController = [[UITabBarController alloc] init];

self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];

self.window.rootViewController = self.tabBarController;

[self.window makeKeyAndVisible];

return YES;

}
  • 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-25T14:55:08+00:00Added an answer on May 25, 2026 at 2:55 pm

    As someone has mention you can add a xib file an configure the app to use it. Here is the code version in case you decide to go this route it’s always best to know either way

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:    (NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
        UIViewController *viewController1 = [[FirstViewController alloc] init];
        UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
        [viewController1 release]; viewController1 = nil;
    
        UIViewController *viewController2 = [[SecondViewController alloc] init];
        UINavigationController *navigationController2 = [[UINavigationController alloc] initWithRootViewController:viewController2];
        [viewController2 release]; viewController2 = nil;
    
        self.tabBarController = [[UITabBarController alloc] init];
    
        NSArray *viewController = [[NSArray alloc] initWithObjects:navigationController1, navigationController2, nil];
        [navigationController1 release]; navigationController1 = nil;
        [navigationController2 release]; navigationController2 = nil;
    
        self.tabBarController.viewControllers = viewControllers;
        [viewControllers release]; viewControllers = nil;
    
        self.window.rootViewController = self.tabBarController;
    
        [self.window makeKeyAndVisible];
    
        return YES;
    }
    

    This is written in the browser but it should work.

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

Sidebar

Related Questions

I thought this would be pretty easy but I'm running into all sorts of
I'm sure that this is pretty easy to do but I'm not sure how
I'm sure this is a pretty easy fix, but I'm not sure why my
I think that this should be pretty easy but I'm not quite sure how
Pretty sure there is an easy answer to this, but just can't find the
This should be pretty easy but I'm having a heck of a time doing
I am sure this is a pretty easy answer, but I have been pulling
I assume this is pretty easy so here goes; I'm trying to execute these
I think this is a pretty easy question...How do I make a asp.net function
I have a feeling that this query is pretty easy to construct, I just

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.