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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:30:05+00:00 2026-06-10T20:30:05+00:00

What is the right way to change XIB View which loaded at app start

  • 0

What is the right way to change XIB View which loaded at app start depending on some app settings. Of course I know how to get all settings I need.

  • 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-10T20:30:06+00:00Added an answer on June 10, 2026 at 8:30 pm

    In your application’s delegate, in the method

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    if(yourSettings)
         myViewController = [[MyViewController alloc] initWithNibName:@"FirstNibName" bundle:nil];
    else
         myViewController = [[MyViewController alloc] initWithNibName:@"SecondNibName" bundle:nil];
    self.window.rootViewController = self.myViewController;
    [self.window makeKeyAndVisible];
    return YES;
    }
    

    And that’s it. Probably you may want to save your settings in your user defaults so you can load the view properly.

    However, I would use 2 different view controllers, as you probably want them to do different things, not just modify some graphics.

    EDIT-

    Let me see if I understand. You will always load the first view controller and, if some conditions are met, you modally want to present the second view controller that will get dismissed at some point, returning the user to the first view controller. If this is the case, I suggest you move the code in your first view controller, in viewDidLoad or better yet in viewDidAppear, as this view controller will always get loaded. Also this way the user can see that he will eventually go to that view controller. I use something like this in applications the user needs to login to so that it will be obvious for him that he cannot continue until he does login.

    I can’t say that this is the right way to do it, because it’s up to the programmer how he arranges his code, but it would seem to me that the place that controls what view and how it appears belongs in a view controller and not in the delegate, especially considering that your first view controller always gets loaded. It should be up to that view controller to see if it presents the second one or not.

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

Sidebar

Related Questions

Which is the right way of declaring a global javascript variable? The way I'm
Is there some way to change Rails environments mid-way through a test? Or, alternately,
I know I can change the tint color of navigation bar in xib file
I would like to know what's the right way to remove a child from
What's the right way to connect a slider to a member variable in MFC?
What the right way to interrupt executor's thread? I've got this: Thread class with
Is this the right way, to use boost::shared_ptr for the nodes left and right
What is the right way to create custom pgsql types for django application so
Is this the right way to do a nested navigation? <dl> <dt>Struktur</dt> <dd> <ul
What's the right way to control timeouts, from the client, when running against a

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.