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

  • Home
  • SEARCH
  • 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 6383167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:36:55+00:00 2026-05-25T02:36:55+00:00

From the standard view-based application, I found that the generated code did this: self.window.rootViewController

  • 0

From the standard view-based application, I found that the generated code did this:

self.window.rootViewController = self.viewController;

So I take it as such that the AppDelegate (self) has a local variable (declared property) named viewController, which is a subclass of UIViewController, and the self.window.rootViewController is pointed towards this view controller.

When a button is clicked on the screen, I would like to jump to a new view.

Now I have created a new subclass of UIViewController, say abcViewController, and a xib file which represents the view. Should I:

(1) replace “viewController” with “abcViewController” so that it becomes the new Application Delegate’s window’s new rootViewController

or

[self.view removeFromSuperview];
[self.parentViewController.view addSubview:abcViewController];

Do I add/remove the view directly, or should I swap the view controllers, then do something to change the view within that view controller? Do I also need a new subclass of UIViewController for every view that I would like to add to the App?

  • 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-25T02:36:56+00:00Added an answer on May 25, 2026 at 2:36 am

    Do like this.

    In viewController class on which event you want to switch the view at there use this,

    -Make object of appDelegate class,
    -then on this object access the window .
    -Make object for new view
    -and add it on window.

    see this,

        YourAppDelegate *obj=(YourAppDelegate *)[[UIApplication sharedApplication] delegate]; 
    
    abcViewController *objAbc=[[[abcViewController alloc] initWithNibName:@"abcViewController" bundle:nil] autorelease];
    
        [obj.window addSubview:objAbc.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Develop a Form Designer, also develop some custom control that inherit from standard
I have a MVC3 application, based on default layout from VS 2010, which I
This is related to my last question . I have an application that I
I have a gridview that imports data from a remote database, this is working
I'm attempting to create a strongly-typed view based on a class from another assembly.
I want to take the input from a standard, off the shelf, IP based
I am using the UINavigationControl based application, I am pushing view one by one.
I refactor some classes from standard SQL to JPA/ORM usage. In most cases the
How a user exception class is created from standard exception? Addressing below cases Say
Is it possible to set welcome-file tag from standard web.xml file by servlet 3.0

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.