在演示文稿正在进行时警告的含义!

cha*_*shu 45 iphone objective-c uinavigationcontroller

当我在我的项目中整合Instagram时.我得到一个imageUIImagePickerController后它,我想将它发送到Instagram的但是当我发送imageInstagram的通过UIDocumentInteractionController委托方法presentOptionsMenuFromRect:inView: animated: 是这样

[documentInteractionController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];
Run Code Online (Sandbox Code Playgroud)

警告出现警告:在演示文稿正在进行时尝试显示<_UIDocumentActivityViewController:0x7584780>!
该应用程序不是崩溃.但我没有得到问题.为什么会出现此警告及其含义.我在互联网上搜索并阅读有关此问题,但没有得到任何答案.帮我 !!

Joh*_*rck 138

// 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];
}];
Run Code Online (Sandbox Code Playgroud)

上面代码的Swift 3版本看起来像这样:

// Breaks
viewController1.dismiss(animated: true)
present(viewController2, animated: true)

// Does not break
viewController1.dismiss(animated: true) {
    present(viewController2, animated: true)
}
Run Code Online (Sandbox Code Playgroud)

请注意上面第二个示例中使用完成处理程序.
它只有viewController2viewController1被完全解雇后才会出现.

  • 这是一个令人难以置信的有价值的提示** - 感谢Johh Erck (9认同)

Mic*_*oya 5

对于那些需要/想要Swift 3版本的人,这里是

viewController1.dismiss(animated: true, completion: {
    self.present(self.viewController1, animated: true)
})
Run Code Online (Sandbox Code Playgroud)

viewController1是要显示的视图控制器。