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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:47:07+00:00 2026-05-20T05:47:07+00:00

I’ve been fighting with this for hours. I’ve searched around everywhere and just can’t

  • 0

I’ve been fighting with this for hours. I’ve searched around everywhere and just can’t seem to find the solution to my problem. I’m pretty sure I’m just lacking some key concepts here.

My AppDelegate (didFinishLaunching) basically sets up my window and invokes RootViewController:

 // create our window
 UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
 [window setBackgroundColor:[UIColor blackColor]];

 // create our rootviewcontroller
 RootViewController *controller = [[RootViewController alloc] init];

 // add our rootviewcontroller's view to our window
 [window addSubview:controller.view];

 // controller is now owned by window's view
 [controller release];

 // show us to the world
 [window makeKeyAndVisible];

When I add controller.view as window’s subview, my understanding is that RootVC’s loadView will automatically get called.

In RootVC loadView, I create a tabBarController, each tab having a navigationController and it’s own viewController. All that is working fine.

In RootVC viewDidLoad, I’m checking to see if this is the first time a user is running this app, and if so, I want to throw up a modal welcome screen. This is the part I’m having trouble with.

I’d like to keep as much code out of the RootVC’s viewDidLoad method, and ideally would be able to accomplish what I want with this:

WelcomeViewController *welcome = [[WelcomeViewController alloc] init];
[self presentModalViewController:welcome animated:true];
[welcome release]; 

Obviously this isn’t working. WelcomeVC’s loadView hasn’t been run yet because I haven’t explicitly set it’s view property. I’ve played around with a bunch of different solutions (welcome.view – [[UIView….], using WelcomeVC’s init method to set self.view) but I just can’t seem to get that modal to pop up.

How should I accomplish what I’m looking for? What are the best practices, and what’s the best solution to keep my code tight and tidy?

I’m stuck, so hopefully your solution will allow me to continue developing my 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-20T05:47:07+00:00Added an answer on May 20, 2026 at 5:47 am

    Although the problem is not so simple, the solution is. You have to wait until the main view appears. So check the condition and present your modal view in viewDidAppear method, not in viewDidLoad method.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.