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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:33:53+00:00 2026-05-21T14:33:53+00:00

I have a simple application with two subclasses of UIViewController. I want to change

  • 0

I have a simple application with two subclasses of UIViewController.

I want to change the view being displayed by my application’s UIWindow by calling a method from one of my UIViewController subclasses.

Essentially I’m just messing around and I’m trying to construct a simple test application with a login screen, that after a user enters credentials a main view is presented. I’m not too familiar with the window and view mechanisms of iOS programming, and I’m currently reading http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/WindowsandViews/WindowsandViews.html#//apple_ref/doc/uid/TP40009503-CH2-SW1 and attempting to learn a bit about it.

  • 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-21T14:33:53+00:00Added an answer on May 21, 2026 at 2:33 pm

    If this is for the purpose of a login screen, you should add the main view controller to window directly, and add the login view controller as a modal view inside the main view controller.

    Inside applicationDidFinishLaunching…

    MainViewController *mainViewController = [[MainView....... // instantiate UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:mainViewController];
    [mainViewController release]; 
    [window addSubview:navController.view];
    

    Inside MainViewController

    -(void)viewWillAppear:(BOOL)animated
    {
        LoginViewController *loginVC = .... //instantiate
        [self.navigationController presentModalViewController:loginVC  animated:NO];
        [loginVC release];
    }
    

    if login successful,

    [self dismissModalViewControllerAnimated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple application in which I want compare two arrays. function check()
I have made a simple test application for the issue, two winforms each containing
I am trying to design a simple application where in I have two entities
Suppose I have a simple to-do list application. The application contains two models: lists
I have a fairly simple iPhone application that I want to have run on
I have a very simple application with two tables, ParentTable and ChildrenTable . Each
I have a very simple application that has only 2 view controllers. The initial
I am trying do a simple application for Android . I have two Activities
I have a simple application with two views, one is a TableView and the
I have created a simple CUDA application to add two matrices. It is compiling

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.