I'm working on iOS 6. My application has a standard navigation controller with embedded a CustomViewController. In this controller I create a modal view like this:
-(IBAction)presentModalList:(id)sender {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
StationsListViewController *list = [storyboard instantiateViewControllerWithIdentifier:@"StationsListViewController"];
[list setStationsData: [self.stationsData allValues]];
[self presentModalViewController:list animated:YES];
}
The modal controller show perfectly but dismissing generates a warning. The dismiss method in this controller is:
-(IBAction)backToMap
{
[self dismissModalViewControllerAnimated:YES];
}
The warning generated is Warning:
Attempt to dismiss from view controller < UINavigationController: 0x1ed91620 > while a presentation or dismiss is in progress!
Any clues about that?
Thanks
I realise this is a late answer but maybe this will help someone else looking for a solution to this, here is what I did:
-(IBAction)backToMap
{
if (![[self modalViewController] isBeingDismissed])
[self dismissModalViewControllerAnimated:YES];
}
For me, i found that line of code was being called multiple times, I couldn't find out why so this was the easiest fix.
Thanks JDx for getting me on the right track. I adapted it to form this solution, which will remove the warning without using functions that are deprecated in iOS 6:
-(IBAction)backToMap
{
if (![self.presentedViewController isBeingDismissed]) {
[self dismissViewControllerAnimated:YES completion:^{}];
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With