After a user selects a picture from their photo library I want to dismiss the imagePickerVierController and present another, but get the error:
Warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress!
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
if (!self.submitPicturesDetailsViewController)
{
self.submitPicturesDetailsViewController = [[SubmitPictureDetailsViewController alloc] initWithPicture: lPicture];
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
{
[self.submitPicturesDetailsViewController setModalPresentationStyle:UIModalPresentationFormSheet];
[self.popOver dismissPopoverAnimated:YES];
[self presentViewController: self.submitPicturesDetailsViewController animated:YES completion: nil];
}else
{
//[self performSelector:@selector(present) withObject: nil afterDelay: 5.0];
[self dismissViewControllerAnimated:NO completion:^{
[self presentViewController: self.submitPicturesDetailsViewController animated:YES completion: nil];
}];
}
}
I have tried:
[self performSelector:@selector(present) withObject: nil afterDelay: 5.0];
And it works properly so apparently the completion block is not working properly.