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.
Move that code from
viewWillAppeartoviewDidAppear– you get delays (and generally await_fenceserror) 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)