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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:50:35+00:00 2026-06-18T07:50:35+00:00

I am adding multiple UISplitViewControllers to a single UITabBarController . The tabs appear, and

  • 0

I am adding multiple UISplitViewControllers to a single UITabBarController. The tabs appear, and each master/child view controller is loaded and displayed properly when the tab is clicked, BUT somehow user interaction only works on the last tab added.

If I add 1 tab, it works fine, but if I add 2 tabs, the 2nd one works and the 1st tab won’t respond to user interaction (nothing happens when clicking user interface elements – they don’t even highlight to show the click). If I add 3, the first 2 are break and the 3rd works.

How can I fix this? Here’s the code (note: this method is called from a splashpage view controller at the end of a startup routine):

- (void)startIPad 
{
    UINavigationController *localNavigationController;
    UISplitViewController *localSplitViewController;
    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    NSMutableArray *localControllersArray = [[NSMutableArray alloc] init];

    //setup the first tab
    Master1ViewController *viewMaster1 = [[Master1ViewController alloc] init];
    Detail1ViewController *viewDetail1 = [[Detail1ViewController alloc] init];
    localNavigationController = [[UINavigationController alloc] initWithRootViewController:viewDetail1];
    localSplitViewController = [[UISplitViewController alloc] init];
    [localSplitViewController setDelegate:viewDetail1];
    localSplitViewController.viewControllers = [NSArray arrayWithObjects:viewMaster1, localNavigationController, nil];
    [localControllersArray addObject:localSplitViewController];
    [viewMaster1 release];
    [viewDetail1 release];
    [localNavigationController release];
    [localSplitViewController release];

    //setup the second tab
    Master2ViewController *viewMaster2 = [[Master2ViewController alloc] init];
    Detail2ViewController *viewDetail2 = [[Detail2ViewController alloc] init];
    localNavigationController = [[UINavigationController alloc] initWithRootViewController:viewDetail2];
    localSplitViewController = [[UISplitViewController alloc] init];
    [localSplitViewController setDelegate:viewDetail2];
    localSplitViewController.viewControllers = [NSArray arrayWithObjects:viewMaster2, localNavigationController, nil];
    [localControllersArray addObject:localSplitViewController];
    [viewMaster2 release];
    [viewDetail2 release];
    [localNavigationController release];
    [localSplitViewController release];

    //setup the third tab
    ...

    //setup the fourth tab
    ...

    //set the UISplitViewControllers onto the tab bar
    tabBarController.viewControllers = localControllersArray;
    [localControllersArray release];

    //switch to the new root view controller
    [appDelegate.window setRootViewController:tabBarController];
    [tabBarController release];
}
  • 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-18T07:50:36+00:00Added an answer on June 18, 2026 at 7:50 am

    I have created a dummy app with your code and its working fine in my app. Just i have initialize the appDelegate like this

    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
        // Override point for customization after application launch.
        //self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
        //self.window.rootViewController = self.viewController;
        [self startIPad];
        [self.window makeKeyAndVisible];
        return YES;
    }
    
    
    
    - (void)startIPad
    {
        UINavigationController *localNavigationController;
        UISplitViewController *localSplitViewController;
        UITabBarController *tabBarController = [[UITabBarController alloc] init];
        NSMutableArray *localControllersArray = [[NSMutableArray alloc] init];
    
        //setup the first tab
        Master1ViewController *viewMaster1 = [[Master1ViewController alloc] init];
        Detail1ViewController *viewDetail1 = [[Detail1ViewController alloc] init];
        localNavigationController = [[UINavigationController alloc] initWithRootViewController:viewDetail1];
        localSplitViewController = [[UISplitViewController alloc] init];
        [localSplitViewController setDelegate:viewDetail1];
        localSplitViewController.viewControllers = [NSArray arrayWithObjects:viewMaster1, localNavigationController, nil];
        [localControllersArray addObject:localSplitViewController];
        [viewMaster1 release];
        [viewDetail1 release];
        [localNavigationController release];
        [localSplitViewController release];
    
        //setup the second tab
        Master2ViewController *viewMaster2 = [[Master2ViewController alloc] init];
        Detail2ViewController *viewDetail2 = [[Detail2ViewController alloc] init];
        localNavigationController = [[UINavigationController alloc] initWithRootViewController:viewDetail2];
        localSplitViewController = [[UISplitViewController alloc] init];
        [localSplitViewController setDelegate:viewDetail2];
        localSplitViewController.viewControllers = [NSArray arrayWithObjects:viewMaster2, localNavigationController, nil];
        [localControllersArray addObject:localSplitViewController];
        [viewMaster2 release];
        [viewDetail2 release];
        [localNavigationController release];
        [localSplitViewController release];
    
        //setup the third tab
       // ...
    
        //setup the fourth tab
        //...
    
        //set the UISplitViewControllers onto the tab bar
        tabBarController.viewControllers = localControllersArray;
        [localControllersArray release];
    
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    
        //switch to the new root view controller
        [appDelegate.window setRootViewController:tabBarController];
        [tabBarController release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I am adding multiple User controls (each containintg datagridview
Let's say customer is adding multiple products to cart. Add car, apartment, tour, some
I have written a code for adding multiple keys for a dictionary for that
I'm having a problem with the new google maps api when adding multiple markers
for an li tag i am adding a div with multiple div dynamically like
Adding more than one child to a WPF StatusBar results in poor layout with
i am adding multiple checkboxes in my asp.net page by doing this: public static
Hi all i am working on jquery i need to avoid adding multiple images
I've started adding multiple languages to my project using resx files (eg. MyText.resx, MyText.ru-RU.resx,
I have one problem while adding multiple events more than 70 events repeatedly again

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.