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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:03:38+00:00 2026-06-07T21:03:38+00:00

I am using TabbarController . When I am in the first tab all other

  • 0

I am using TabbarController. When I am in the first tab all other tabItem in a disable mode and I have one button in the first tab viewcontroller, on clicking that button it should move to the second tabitem. I have implemented setselectedindex but no change in that.

 - (void)clinicBtnTapped
 {        
    enteredSecondTab==YES;
    CustomTabBar *tabbar=[[CustomTabBar alloc] init];

    [self.tabBarController setSelectedIndex:1];

    AppSys_SplitView *apptmtSys=[[AppSys_SplitView alloc] init];

    [tabbar tabBarController:tabbar.tabBarController shouldSelectViewController:apptmtSys];
    tabindex=1;
    [tabbar tabBarController:tabbar.tabBarController didSelectViewController:appsys];

}

In Should Select ViewController

    - (BOOL)tabBarController:(UITabBarController *)tabBarControlle shouldSelectViewController:(UIViewController *)viewController{

   tabindex = [[tabBarControlle viewControllers] indexOfObject:viewController];
    NSLog(@"index %d",index);

    for(UIImageView *view in[self.view subviews]){

        [view removeFromSuperview];
    }
        tabBarController.imgV.frame=CGRectMake(0, 717, 1024, 53);

    switch (tabindex) {

        case 0:

            enteredFirstTab = YES;
            enteredSecondTab = NO;
            enteredThirdTab = NO;
            enteredFourthTab = NO;
            tabBarController.imgV.image=[UIImage imageNamed:@"select_TrackClinic_icon.png"];


            return YES;
            break;

        case 1:             
            if(enteredSecondTab == YES)
            {
                enteredFirstTab = NO;
                enteredSecondTab = YES;
                enteredThirdTab = NO;
                enteredFourthTab = NO;
                tabBarController.imgV.image=[UIImage imageNamed:@"select_Application_icon.png"];
                return YES;
            }
            else 
            {
                return YES;
            }



            break;


        case 2:

            return NO;

            enteredFirstTab = NO;
            enteredSecondTab = NO;
            enteredThirdTab = YES;
            enteredFourthTab = NO;
            tabBarController.imgV.image=[UIImage imageNamed:@"select_regularOnsite_icon.png"];

            break;

        case 3:

            return NO;

            enteredFirstTab = NO;
            enteredSecondTab = NO;
            enteredThirdTab = NO;
            enteredFourthTab = YES;
            tabBarController.imgV.image=[UIImage imageNamed:@"select_resultUpdate_icon.png"];
            break;

        default:

            break;

    }       

}
  • 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-07T21:03:39+00:00Added an answer on June 7, 2026 at 9:03 pm

    Here I can give you some tutorial for implementing the custom tabbar

    Delegate.h file

    @interface cTabBarAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> 
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
    @property (nonatomic, retain) IBOutlet UIImageView *imgV;
    @end
    

    Delegate.m file

    @implementation cTabBarAppDelegate
    
    @synthesize window=_window;
    @synthesize tabBarController=_tabBarController;
    @synthesize imgV = _imgV;
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // Override point for customization after application launch.
        // Add the tab bar controller's current view as a subview of the window
        self.tabBarController.delegate=self;
        self.imgV.frame=CGRectMake(0, 425, 320, 55);
        [self.tabBarController.view addSubview:self.imgV];
        self.tabBarController.selectedIndex=0;
        self.window.rootViewController = self.tabBarController;
        [self.window makeKeyAndVisible];
        return YES;
    }
    
    - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
        NSUInteger index=[[tabBarController viewControllers] indexOfObject:viewController];
    
        switch (index) {
            case 0:
                self.imgV.image=[UIImage imageNamed:@"tBar1.png"];
                break;
            case 1:
                self.imgV.image=[UIImage imageNamed:@"tBar2.png"];
                break;
            case 2:
                self.imgV.image=[UIImage imageNamed:@"tBar3.png"];
                break;
            case 3:
                self.imgV.image=[UIImage imageNamed:@"tBar4.png"];
                break;
            case 4:
                self.imgV.image=[UIImage imageNamed:@"tBar5.png"];
                break;
            default:
                break;
        }
    
        return YES;
    }
    

    Following code put into viewcontroller.m

      AppDelegate   *delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    
        SearchVctr *viewController1 = [[SearchVctr alloc] initWithNibName:@"SearchVctr" bundle:nil];
        UINavigationController *navForRentResidental= [[UINavigationController alloc]initWithRootViewController:viewController1];
    
        UIViewController *viewController2 = [[FavouriteVctr_iphone alloc] initWithNibName:@"FavouriteVctr_iphone" bundle:nil];
        UINavigationController *navForFavorite= [[UINavigationController alloc]initWithRootViewController:viewController2];
    
        UIViewController *viewController3 = [[LoginAndRegisterVctr alloc] initWithNibName:@"LoginAndRegisterVctr" bundle:nil];
        UINavigationController *navForLogin= [[UINavigationController alloc]initWithRootViewController:viewController3];
        navForLogin.navigationBar.hidden=TRUE;    
    
        UIViewController *viewController4 = [[ContactUsVctr alloc] initWithNibName:@"ContactUsVctr" bundle:nil];
        UINavigationController *navForContact= [[UINavigationController alloc]initWithRootViewController:viewController4];
    
        UIViewController *viewController5 = [[MoreVctr_iphone alloc] initWithNibName:@"MoreVctr_iphone" bundle:nil];
        UINavigationController *navForMore= [[UINavigationController alloc]initWithRootViewController:viewController5];
    
        navForContact.navigationBar.hidden=TRUE;
        navForMore.navigationBar.hidden=TRUE;
        navForLogin.navigationBar.hidden=TRUE;
        navForFavorite.navigationBar.hidden = TRUE;
    
        if([sender tag] == 1){
            delegate.tabBarController.viewControllers = [NSArray arrayWithObjects:navForRentResidental, navForFavorite, navForLogin, navForContact, navForMore, nil];
            delegate.tabBarController.selectedIndex = 3;
            delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t4.png"]];
            delegate.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
            [self presentModalViewController:delegate.tabBarController animated:YES];
        }else if([sender tag] == 2){
            UIViewController *viewController5 = [[AboutVctr alloc] initWithNibName:@"AboutVctr" bundle:nil];
            delegate.tabBarController.viewControllers = [NSArray arrayWithObjects:navForRentResidental, navForFavorite, navForLogin, navForContact, viewController5, nil];
            delegate.tabBarController.selectedIndex = 4;
            delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t5.png"]];
            delegate.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
            [self presentModalViewController:delegate.tabBarController animated:YES];
        }
            else if([sender tag] == 3){
            UIViewController *viewController5 = [[ServicesVctr alloc] initWithNibName:@"ServicesVctr" bundle:nil];
            UINavigationController *navcontroller= [[UINavigationController alloc]initWithRootViewController:viewController5];
            navcontroller.navigationBar.hidden=TRUE;
            delegate.tabBarController.viewControllers = [NSArray arrayWithObjects:navForRentResidental, navForFavorite, navForLogin, navForContact, navcontroller, nil];
            delegate.tabBarController.selectedIndex = 4;
        delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t5.png"]];
            delegate.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
            [self presentModalViewController:delegate.tabBarController animated:YES];
        }
        else if([sender tag] == 4){
            delegate.tabBarController.viewControllers = [NSArray arrayWithObjects:navForRentResidental, navForFavorite, navForLogin, navForContact, navForMore, nil];
            delegate.tabBarController.selectedIndex = 2;
            delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t3.png"]];
             delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t3.png"]];
            delegate.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
            [self presentModalViewController:delegate.tabBarController animated:YES];
        }
            else if([sender tag] == 5){
            delegate.tabBarController.viewControllers = [NSArray arrayWithObjects:navForRentResidental, navForFavorite, navForLogin, navForContact, navForMore, nil];
            delegate.tabBarController.selectedIndex = 0;
            delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t1.png"]];
            delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t1.png"]];
                            delegate.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
            [self presentModalViewController:delegate.tabBarController animated:YES];
    
        }
    

    This code may helping to development.

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

Sidebar

Related Questions

I am using TabBarController with two tabs one is InputViewController and another tab is
I have an ios5 app developed using storyboards that currently displays a tab bar
Assume that I have an application using tabbarcontroller with 10 UIViewControllers, once the UIViewController
I am building an iphone application. I have a tabbarcontroller that has 2 tab
I'm using a TabBarController with a few Tabs and I have memory problems when
I have a tab bar controller with two tabs: tabBar1View with a button named
I have a tabbar controller and on touching a button in one of view's
I am using TabBarController in my application. In one of the view of the
I have a tab bar MainViewController with a few tab bar buttons, the first
Using storyboards you have no easy access to the first view controller in appDelegate

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.