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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:43:45+00:00 2026-05-25T21:43:45+00:00

Iknow how to add a TabBar with two TabBar buttons on it by Interface

  • 0

Iknow how to add a TabBar with two TabBar buttons on it by Interface Builder. And I link each button to a Navigation Controller.

Now I want to learn how to do everything programmatically. Now I can see a TabBar in simulator but with no buttons on it. Can someone please help me with this. Thanks!

Here’s the TabBarAppDelegate.h.

#import <UIKit/UIKit.h>
@interface TabBarAppDelegate : NSObject <UIApplicationDelegate> 
{
    UIWindow *window;
    UITabBarController *tabBarController;
    IBOutlet UINavigationController *navigationController1;
    IBOutlet UINavigationController *navigationController2;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UITabBarController *tabBarController;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController1;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController2;
@end

Here’s TabBarAppDelegate.m.

#import "TabBarAppDelegate.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
@implementation TabBarAppDelegate
@synthesize window=window;
@synthesize tabBarController;
@synthesize navigationController1;
@synthesize navigationController2;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    tabBarController = [[UITabBarController alloc]init];   
    FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
    firstViewController.title = @"First";
    [self.navigationController1 pushViewController:firstViewController animated:NO];

    SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
    secondViewController.title = @"NavCal";
    [self.navigationController2 pushViewController:secondViewController animated:NO];

    tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController1, navigationController2, nil];

    [window addSubview:tabBarController.view];
    [self.window makeKeyAndVisible];
    [firstViewController release];
    [secondViewController release];
    return YES;
}

- (void)dealloc
{
    [tabBarController release];
    [window release];
    [super dealloc];
}
  • 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-25T21:43:46+00:00Added an answer on May 25, 2026 at 9:43 pm

    It looks like you are not initializing the navigation view controllers. See if this would work:

    TabBarAppDelegate.h

    • Remove the properties navigationController1 and navigationController2

    TabBarAppDelegate.m

    • Replace

      [self.navigationController1 pushViewController:firstViewController animated:NO];
      

    with

    UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:firstViewController];
    
    • Replace

      [self.navigationController2 pushViewController:secondViewController animated:NO];
      

    with

    UINavigationController *navigationController2 = [[UINavigationController alloc] initWithRootViewController:secondViewController];
    
    • Release navigationController1 and navigationController2 after adding them to the tabBarController
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As i know,MPVolumeView can add to my app for changing volume.But now i want
I want to add values to combobox in C++ builder 6. I know I
I know that when you add/change/remove methods in a COM interface you're supposed to
I've a weird problem. I'm using a navigationController and want to add a subview
Greetings! Here's the scenario. Starting with a navigation controller (and no tab bar is
I want to add/edit and deleted the contacts in iphone contacts from my iphone
I want to ask that how can I add a Background Worker component through
I know that add is faster as compared to mul function. I want to
I know add() adds the specified (signed) amount of time to the given time
Why does C++ need and use pointers? I know they add power to the

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.