警告的含义“在演示过程中!" [英] Meaning of Warning "while a presentation is in progress!"

查看:14
本文介绍了警告的含义“在演示过程中!"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将 Instagram 集成到我的项目中时.我从 UIImagePickerController 得到一个 image 之后我想将它发送到 Instagram 但是当我发送 imageInstagram 通过 UIDocumentInteractionController 委托方法 presentOptionsMenuFromRect:inView: animated: like this

When I am integarting the Instagram in my project. I am getting a image from UIImagePickerController and after it i want to send it to Instagram But when I am sending image to Instagram by UIDocumentInteractionController delegate method presentOptionsMenuFromRect:inView: animated: like this

[documentInteractionController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];

警告出现警告:在演示过程中尝试显示 <_UIDocumentActivityViewController: 0x7584780>!
应用程序没有崩溃.但我没有得到问题.为什么会出现这个警告以及它的含义.我在互联网上搜索并阅读了有关此的问题,但没有得到任何答案.帮帮我!!

The warning comes Warning: Attempt to present <_UIDocumentActivityViewController: 0x7584780> on while a presentation is in progress!
The application is not Crashing. But I am not getting the Problem. Why this warning comes and what It means. I searched on Internet and read questions about this but not got any answer. Help me !!

推荐答案

// 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];
}];

上述代码的 Swift 3 版本如下所示:

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)
}

请注意上面第二个示例中完成处理程序的使用.
它仅在 viewController1 完全关闭后呈现 viewController2.

Note the use of the completion handler in the second example above.
It only presents viewController2 after viewController1 has been fully dismissed.

这篇关于警告的含义“在演示过程中!"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆