In a project I’m writing I get this error when I present a new view controller:
Attempt to present…. while a presentation is in progress!
I think it happens because I first present a new view controller, and then in that view I present another view controller.
- (void)loadLabelSettings {
LabelSettingsViewController *labelSettings =
[[LabelSettingsViewController alloc] init];
labelSettings.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:labelSettings animated:YES completion:nil];
}
The program doesn’t crash or anything it runs just fine, and there is no errors or warnings in my code. So my question is: Is it something I should be concerned with and if yes how do I solve it?
Thanks in advance 🙂
It is, like you said, probably caused by presenting two view controllers at the same time. Wait with presenting the second view controller until the first one has been fully presented. A good location would be to do this in
viewDidAppear.