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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:01:25+00:00 2026-06-16T01:01:25+00:00

I want to load a tabBarController with no tabBar selected. Actually each tabBarItem corresponds

  • 0

I want to load a tabBarController with no tabBar selected. Actually each tabBarItem corresponds to a certain ViewController.But I have a view “Success” and it doesnot belong to any tabBarItem.So when Successview appears then I need a tabBarController with three tabBarItems (Search,Settings) need to appear and when any tabbaritem is then selected then corresponding ViewController should appear and SuccesView should disappear.
Gone through google and find out this but couldn’t make it working.

In SuccessView.m

- (void)viewDidLoad
{
    [super viewDidLoad];

// UIlabels and UITextFields loads

SuccessView *defaultView = [[SuccessView alloc]initWithNibName:@"SuccessView" bundle:[NSBundle mainBundle]];
    [self.tabBarController setSelectedViewController:nil];
    [self.tabBarController setSelectedViewController:defaultView];

    SearchView *first = [[SearchView alloc] initWithNibName:@"SearchView" bundle:nil];
    first.title=@"Search";

    Settings *second=[[Settings alloc]initWithNibName:@"Settings" bundle:nil];
    second.title=@"Settings";

    NSArray *viewArray= [NSArray arrayWithObjects:first,second, nil];

    tabbarController=[[UITabBarController alloc] init];
    [tabbarController setViewControllers:viewArray animated:NO];

    [self presentModalViewController:tabbarController animated:NO];
}

But I dont find any tabbarController added to SuccessView.Where I m going wrong?

  • 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-16T01:01:27+00:00Added an answer on June 16, 2026 at 1:01 am

    Even i had the same situation i used UITabbar and tabbar items instead of UITabBarController because UITabBarController expects a current view from any of the tabbar items placed… Here’s the code..This should get you going:)

     UITabBar *tabBar = [[UITabBar alloc] initWithFrame:CGRectMake(your frame)];   
      NSMutableArray  *tabBarItemsArray= [[NSMutableArray alloc] init];
        UITabBarItem *tabBarItem1 = [[UITabBarItem alloc] initWithTitle:@"artist" image:[UIImage imageNamed:@"artist-tab.png"] tag:1];//assigning the title name and image
    
        [tabBarItem1 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:48.0/255.0  green:60.0/255.0 blue:109.0/255.0 alpha:1.0],UITextAttributeTextColor,nil] forState:UIControlStateNormal];//set the color when the tabbar appears
    
        [tabBarItem1 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor,nil] forState:UIControlStateSelected];//sets the color when the tabbar is selected
    
         UITabBarItem *tabBarItem2 = [[UITabBarItem alloc] initWithTitle:@"Facebook" image:[UIImage imageNamed:@"music-tab.png"] tag:2];
    
        [tabBarItem2 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:48.0/255.0  green:60.0/255.0 blue:109.0/255.0 alpha:1.0],UITextAttributeTextColor,nil] forState:UIControlStateNormal];
    
        [tabBarItem2 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor,nil] forState:UIControlStateSelected];
    
                [tabBarItemsArray addObject:tabBarItem1];
                [tabBarItemsArray addObject:tabBarItem2];
                tabBar.items = tabBarItemsArray;
                tabBar.delegate = self;
    
             [self.view addSubview:tabBar];
    

    Make sure you add the delegate UITabBarDelegate in your header file to implement this method

       - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
            NSLog(@"Tabbar selected itm %d",item.tag); 
       // here you can call your view based on tab click you can try using switch statements here based on item.tag
           }
    

    Hope this answers your question and helps:)

    Also,we can customize the UITabbar with an image…do let me know..i will post the code in here if you want.

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

Sidebar

Related Questions

I want load html with ajax. But i have problems with it. When you
I want to load a palette from a bitmap file I have created. The
I have a tabbar controller and on touching a button in one of view's
I want load xml documents, but there are special symbols like : ąčęėįšųū and
I have 2 select, I want the second select list loads based on selected
I have database dump and I want load it to sqlite database on iphone
I want to load a nib that isn't a view in a UITabViewController. Here's
now i load one AQGridView in UIViewController, its working good, but i want load
my application have a tabbarcontroller with 4 view Controllers. Its called here : self.window.rootViewController
I have a Tab Bar Application and I want to simply display a view

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.