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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:46:06+00:00 2026-06-02T02:46:06+00:00

I have a UISplitViewController with a UIViewController as master and a UINavigationController as my

  • 0

I have a UISplitViewController with a UIViewController as master and a UINavigationController as my details controller (which contains an actual DetailsController as it’s rootController).

In iOS5, at app startup (holding the device in landscape view), I add the splitViewController’s view to my window but then I present a loginController on top of the splitViewController like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.

    KRMasterViewController *masterViewController = [[[KRMasterViewController alloc] initWithNibName:@"KRMasterViewController" bundle:nil] autorelease];
    UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];

    KRDetailViewController *detailViewController = [[[KRDetailViewController alloc] initWithNibName:@"KRDetailViewController" bundle:nil] autorelease];
    UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease];

    self.splitViewController = [[[UISplitViewController alloc] init] autorelease];
    self.splitViewController.delegate = detailViewController;
    self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil];
    [self.window addSubview:self.splitViewController.view];

    LoginController *controller=[[LoginController alloc]
                                        initWithNibName:@"LoginController" bundle:nil];
    [self.splitViewController presentModalViewController:controller animated:false];

    [self.window makeKeyAndVisible];
    return YES;
}

As you can see the detailsController is my splitViewController’s delegate. The problem is in iOS4, before the loginController gets displayed, the delegate method:

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem 
       forPopoverController:(UIPopoverController *)popoverController

is called then when I dismiss the loginController the delegate method:

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem

gets called. I guess iOS realizes really late that I’m in landscape but figures out before I got to the detailController so everything was cool. In iOS 5, the second method does not get called by the time I get to the splitViewController. This means I’m left with the barButtonItem visible in landscape view. Funny enough, if I rotate to portrait then back to landscape, the methods gets called properly from then on. Anyone ever experienced this before? Any solutions?

  • 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-02T02:46:07+00:00Added an answer on June 2, 2026 at 2:46 am

    I ended up switching the root controller from being a navigation controller (when logging in) to a splitview controller for the main menu:

    -(void)goToLogin{
       self.rootSplitController=nil;
    
       UINavigationController* navController=[[UINavigationController alloc]init];
       navController.navigationBarHidden = true;
       self.rootNavController=navController;
       [navController release];
    
       LoginController *loginController=[[LoginController alloc]init];
       [self.rootNavController pushViewController:loginController animated:false];
       [loginController release];
    
       [self.window addSubview:self.rootNavController.view];
    }
    
    -(void)goToMain{
       self.rootNavController=nil;
    
       MasterController *masterViewController = [[[MasterController alloc] 
          initWithNibName:@"MasterController" bundle:nil] autorelease];
       UINavigationController *masterNavigationController = [[[UINavigationController alloc] 
          initWithRootViewController:masterViewController] autorelease];
       masterNavigationController.navigationBarHidden=true;
    
       DetailsController *detailViewController = [[[DetailsController alloc] 
          initWithNibName:@"DetailsController" bundle:nil] autorelease];
       UINavigationController *detailNavigationController = [[[UINavigationController alloc] 
          initWithRootViewController:detailViewController] autorelease];
       detailNavigationController.navigationBarHidden=true;
    
       self.rootSplitController = [[[UISplitViewController alloc] init] autorelease];
       self.rootSplitController.delegate = detailViewController;
       self.rootSplitController.viewControllers = [NSArray arrayWithObjects:
        masterNavigationController, detailNavigationController, nil];
    
       [self.window addSubview:self.rootSplitController.view];
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iPad application, i have used UISplitViewController where master view contains table view
I have a UISplitViewController in which i'm attempting to pass an int value from
I have 4 UIBarButtonItems inside a UISplitViewController's right hand side (the detail controller). I'm
I'm using UISplitViewController for app on iPad. The first task was to show master
I am doing an iPad app based on a UISplitViewController. I have a little
I have a UISplitViewController containing a UINavigationController on the left hand side and another
I have an app for iPad with a UISplitViewController in it (UsersSplitViewController). On the
I have a UISplitViewController which has a UIWebView assigned to its detailedView. The problem
I have a UISplitViewController in a xib file that contains two custom UIViewControllers. I
I have a universal app, and on the iPad version I'm using UISplitViewController to

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.