When I am integarting the Instagram in my project. I am getting a image
from UIImagePickerController
and after it i want to send i
It means you are presenting or dismissing UIImagePickerController
and trying to present UIDocumentInteractionController
, while first presentation or dismissing is not completed.
As it was said before, this means that you are trying to present 2 modal windows or popovers at the same time. But in my case I haven't seen any modal window or popover when I getting this message.
The reason for the error in my case was following. When I called the popover to show up for the very first time, it was another error which prevent popover to show but it somehow continue to be in "presented" state. All following attempts to show popover failed with runtime error "while a presentation is in progress!”.
So, if you run into the same situation, look through the log and try find very first error starting with *** WebKit discarded an uncaught exception in the...
.
Hope it will save somebody's time.
i got this message because i copied pasted a button that already had sent event attached to it and i continued to create another connection since new button was supposed to open new view.
So technically i was trying to open 2 views at the same time.
This can also occur if you've got (say) a UIButton hooked up to an IBAction to present a ViewController, and also create a segue in the Storyboard from the button to the target ViewController.
Had this happen when I forgot to delete the IBAction connection from a UIButton when I shifted some interactions around.
Deleting either the IBAction connection or the segue will resolve it.
// Breaks
[viewController1 dismissViewControllerAnimated:YES completion:NULL];
[self presentViewController:viewController2 animated:YES completion:NULL];
// Does not break
[viewController1 dismissViewControllerAnimated:YES completion:^{
[self presentViewController:viewController2 animated:YES completion:NULL];
}];
The Swift 3 version of the above code would look like this:
// Breaks
viewController1.dismiss(animated: true)
present(viewController2, animated: true)
// Does not break
viewController1.dismiss(animated: true) {
present(viewController2, animated: true)
}
Note the use of the completion handler in the second example above.
It only presents viewController2
after viewController1
has been fully dismissed.
This means that you are presenting 2 ViewControllers at the same time. Call your delegate after the first presentation is completed.