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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:04:50+00:00 2026-05-26T13:04:50+00:00

I have this case where I am using a custom UITabBar in my application.

  • 0

I have this case where I am using a custom UITabBar in my application.
It is working great in ios4 on both device and simulator.

But running the same code using xcode 4.2 and ios5 sdk wont work, as the app is crashing when I am setting the view controllers of my custom tabBarController on this line:

tabBarController.viewControllers = [NSArray arrayWithObjects:nc1, nc2, nc3, nil];

Here is how I am creating the tabBar:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    tabBarController = [[MBCustomTabBarController alloc] init];

    home=[[Home alloc] initWithNibName:@"Home" bundle:nil];
    UINavigationController *nc1=[[UINavigationController alloc] initWithRootViewController:home];

    live=[[Live alloc] initWithNibName:@"Live" bundle:nil];
    UINavigationController *nc2=[[UINavigationController alloc] initWithRootViewController:live];

    report=[[Report alloc] initWithNibName:@"Report" bundle:nil];
    UINavigationController *nc3=[[UINavigationController alloc] initWithRootViewController:report];


    //custom tabbar items
    MBCustomTabBarItem *firstItem = [[MBCustomTabBarItem alloc] initWithTitle:@"headlines" image:[UIImage imageNamed:@"HOME-.png"] tag:0];
    MBCustomTabBarItem *secondItem = [[MBCustomTabBarItem alloc] initWithTitle:@"live" image:[UIImage imageNamed:@"NEWS-.png"] tag:1];
    MBCustomTabBarItem *thirdItem = [[MBCustomTabBarItem alloc] initWithTitle:@"report" image:[UIImage imageNamed:@"REPORT-.png"] tag:2];


    [firstItem setImage:[UIImage imageNamed:@"HOME.png"] forState:UIControlStateSelected];
    [secondItem setImage:[UIImage imageNamed:@"NEWS.png"] forState:UIControlStateSelected];
    [thirdItem setImage:[UIImage imageNamed:@"REPORT.png"] forState:UIControlStateSelected];

    nc1.tabBarItem=firstItem;
    nc2.tabBarItem=secondItem;
    nc3.tabBarItem=thirdItem;

    [firstItem release];
    [secondItem release];
    [thirdItem release];


    tabBarController.viewControllers = [NSArray arrayWithObjects:nc1, nc2, nc3, nil];
    [nc1 release];
    [nc2 release];
    [nc3 release];
    tabBarController.customTabBar.frame = CGRectMake(0, 480 - 49, 320, 49);
    tabBarController.customTabBar.backgroundColor = [UIColor clearColor];
    tabBarController.customTabBar.itemWidth = 320 / [self.tabBarController.viewControllers count];


    [self.window addSubview:tabBarController.view];
    [self.window makeKeyAndVisible];

    return YES;
}

And here is a small working example.

Your help is highly appreciated.

  • 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-26T13:04:51+00:00Added an answer on May 26, 2026 at 1:04 pm

    Never mind, I’ve totally changed my approach and used this answer to build my custom tabBar. And it is working fine under ios5.

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

Sidebar

Related Questions

Scenario: I have a document I created using LaTeX (my resume in this case),
So, I have a product that has custom options. In this case, its color.
I have a multithreaded application that runs using a custom thread pool class. The
In an ASP.NET MVC application when using a custom Dependency Injection container (in this
I have this case <WrapPanel> <CheckBox>Really long name</CheckBox> <CheckBox>Short</CheckBox> <CheckBox>Longer again</CheckBox> <CheckBox>Foo</CheckBox> <Slider MinWidth=200
I have this use case of an xml file with input like Input: <abc
I have this test case def setUp(self): self.user = User.objects.create(username=tauri, password='gaul') def test_loginin_student_control_panel(self): c
Imagine this case where I have an object that I need to check a
I have this SQL query select case when AllowanceId is null then 2 else
i have this block of xslt if-else case and was wondering if there's a

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.