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 implemented pretty simple application, using gwt and gwt event service 1.1.1, it
I have a fairly simple Rails application that allows users to manage their clients
I would like to create a simple application for communicate between two Android phones.
I have two simple Model classes and a ViewModel... public class GridItem { public
I have successfully setup a simple mvc application that lists teams. I'm using Ninject
I have Xcode 4 and I created an application using the Tab Bar template
I'm supposed to make a simple application, an xHTML editor with some basic validation
I'm developing an application using Apache Click, aimed for mobile browsers -- so I
One of my entity managed objects need to setup a runtime-only tree-like structure where
I was curious about how the MongoDB plugin for Grails would handle relationships. In

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.