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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:27:54+00:00 2026-06-03T06:27:54+00:00

I have this code in the viewWillAppear of my initial View Controller if (howManyLeft

  • 0

I have this code in the viewWillAppear of my initial View Controller

if (howManyLeft == 0) {
        NSLog(@"HERE");
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
        DayCompleteViewController *dayComplete = (DayCompleteViewController *)[storyboard instantiateViewControllerWithIdentifier:@"dayComplete"];
        dayComplete.delegate = self;
        [self presentModalViewController:dayComplete animated:YES];
    }

The NSLog fires correctly, however the 2nd view isn’t displayed straight away.
If you later click on a tableview cell, which shows a popup view, then dismiss the popup view, the modal view is then presented even though there is no other code to display the modal view.

Why isn’t it displayed immediately on launch instead of waiting for some things to happen first?

I had this working fine when I had a NavigationController and segue, however I have since removed it as it wasn’t needed.

  • 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-03T06:27:55+00:00Added an answer on June 3, 2026 at 6:27 am

    Move that code from viewWillAppear to viewDidAppear – you get delays (and generally a wait_fences error) because you are trying to present a modal view controller before the current view has appeared (so it would be trying to present both view controllers at once)

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

Sidebar

Related Questions

I have the following code - (void) viewWillAppear:(BOOL)animated { NSLog(@dismiss view); [self dismissModalViewControllerAnimated:YES]; }
I have this code here, which is intended to allow any type of arguments:
I have a strange situation in one view controller where this line crashes in
In my loadView methoad of my view controller I have the following code: //
I have added UITabButtonItem onto my view controller using following code. Could anyone please
I have the following code in my viewWillAppear: - (void) viewWillAppear:(BOOL)animated{ self.view.backgroundColor = [UIColor
I have this code : -(IBAction)OkButtonPressed:(id)sender{ NSLog(@BTN OK); RecherchePartenaireTableView *recherchePartenaireTableView=[[RecherchePartenaireTableView alloc]init]; recherchePartenaireTableView.mytext=textFieldCode.text; [self.navigationController popViewControllerAnimated:YES];
I have this code for doing an ajax request to a webservice: var MyCode
I have this code: $(div[id^='intCell']).mouseover(function() { $(this).css({ border:,1px solid #ff097c}); }).mouseout(function() { $(this).css({border:,1px solid
I have this code to show a map using the Virtual Earth API: <script

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.