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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:45:10+00:00 2026-06-14T15:45:10+00:00

I am developing an iPad application where the user just can (in some cases)

  • 0

I am developing an iPad application where the user just can (in some cases) open the app, if he types in a password.
Therefore I need something like a LoginViewController. But first, let us handle the common case, where the app just needs to display the HomeViewController:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{  
    //...
    self.controllerHomeView = [[HomeViewController alloc] initWithNibName:@"HomeView" bundle:nil];
    self.controllerHomeView.showInitialGuide = isFirstLaunch;
    self.window.rootViewController = controllerHomeView;
    [self.window makeKeyAndVisible];
    //..
}

But, like I said before, some users may have defined a password and if so, we need to display a login screen. That’s what I did to enable such a feature:

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    //---
    if(isAppPinSecured && !loginIsAlreadyDisplaying) {
        LoginBackgroundViewController *controllerLoginBG = [[LoginBackgroundViewController alloc] initWithNibName:@"LoginBackgroundView" bundle:nil];
        self.appPinInputBG = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default-Landscape@2x~ipad.png"]];
        self.appPinInputBG.frame = CGRectMake(0, 0, 1024, 748);
        self.appPinInputBG.userInteractionEnabled = YES;
        [controllerLoginBG.view addSubview:self.appPinInputBG];
        //present new root = background
        self.window.rootViewController = controllerLoginBG;
        //...
    }
}

What I am doing is, changing the root view controller to LoginViewController and if the user puts in the correct password, changing back from the LoginViewController to the HomeViewController.

Everything works fine so far, except the orientation. If the current interface orientation is unknown, because the iPad e.g. is laying on a table, the LoginViewController orientation is LandscapeRight instead of the one in the HomeViewController (LandscapeLeft).
It works properly if holding the iPad in your hands, but otherwise precisely not.

Any suggestions on how to fix that issue? I did set my app orientation in the plist file (Landscape Left). I do implement shouldAutorotate with UIInterfaceOrientationIsLandscape(…) in both – Home- and LoginViewController.

Thanks in advance!

  • 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-14T15:45:11+00:00Added an answer on June 14, 2026 at 3:45 pm

    Argh, the problem was, that I tried to push a view controller modally before viewDidAppear was called -> you should never do this…

    After changing my code due to this error it worked like a charm

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

Sidebar

Related Questions

I am developing an iPad application. For some reasons, I need to show a
I am developing an iPad application in which I need a table view (
I am developing an iPad app which uses webKit to process video content. Some
I am developing iPad Application and did all orientations. But some times the application
I am developing iPad application using phonegap (cordova 1.9.0). I need to get current
I'm developing an iPad application in which a user fills in their details and
Im developing an iPad application and in my app, Im using an outer scroll
I am developing an application for iPad that need data from a ODATA service.
We are developing an HTML5 + CSS3 application for iPad and iPhone. The app
I've been developing an iPad application that uses UIWebView to display some text and

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.