在用户从他们的照片库中选择一张图片后,我想关闭 imagePickerVierController 并呈现另一个,但得到错误:
警告:在演示或关闭过程中尝试从视图控制器中关闭!
- (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];
}];
}
}
我努力了:
[self performSelector:@selector(present) withObject: nil afterDelay: 5.0];
它工作正常,所以显然完成块不能正常工作。