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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:18:45+00:00 2026-05-23T10:18:45+00:00

I have a viewcontroller containing a TabController. Before this loads, I want a user

  • 0

I have a viewcontroller containing a TabController. Before this loads, I want a user to login so I can check what they have access to. In my AppDelegate, bot the rootViewController (with the tabs) and the LoginViewController are declared, and they’re also wired up in IB:

I have this in my AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//  [window addSubview:[rootController view]];
        [window addSubview:[loginViewController view]];
    [self.window makeKeyAndVisible];

    return YES;
}

My plan was to dismiss the login form after authenticating and show the rootController, but the rootController displays straight away. I was going to do:

-(IBAction)DidClickLoginButton:(id)sender {
     NotesAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
    [delegate.window addSubview:[delegate.rootController view]];
    [self dismissModalViewControllerAnimated:YES];
}

iNotesAppDelegate
Is there an easier way to do this? I can’t see why the LoginViewController isn’t presented.

EDIT: Eventually got this working by adding it to the rootController in my AppDelegate’s didFinishLaunchingWithOptions method

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//  [window addSubview:[rootController view]];
    [self.window makeKeyAndVisible];
    LoginViewController *loginViewController =[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil];
    [self.rootController presentModalViewController:loginViewController animated:YES];
    return YES;
}
  • 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-05-23T10:18:46+00:00Added an answer on May 23, 2026 at 10:18 am

    Yes it would. As you are adding the root controller view on the window, and this would make it appear above all (even above the login view) and then your login view gets dismissed behind the root view, which you cannot see.

    EDIT:
    One of the approach would be to have login controller above root in the beginning itself (root view controller presenting login view) and then happily dismiss the login view.

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

Sidebar

Related Questions

I have a viewController (Planner) that loads two view controllers (InfoEditor and MonthlyPlan) when
I have spent the last several hours trying to get this to work and
I have a view containing a number of UIButtons Tom and Jerry, The Lion
I have a plist with root of type dictionary containing keys of type array,
Lets say I have a view, myView, a view controller, myViewController, and some sort
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I

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.