当我将Instagram整合到我的项目中时.我从UIImagePickerController得到一个image,之后我想把它发送到Instagram,但当我通过UIDocumentInteractionController发送imageInstagram时,像这样的方法presentOptionsMenuFromRect:inView: animated:

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

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版本如下所示:

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

// Does not break
viewController1.dismiss(animated: true) {
    present(viewController2, animated: true)
}

请注意上面第二个示例中使用的完成处理程序

Objective-c相关问答推荐

错误无法使 UICollectionElementKindCell 类型的视图出列

如何测试 NSCFBolean 值?

如何删除警告按钮的框架在运行时会有所不同.

将类作为参数传递?

具有动态高度的子视图的自动布局 UIScrollView

在 UITableViewCells 上显示复制弹出窗口的简单方法,如地址簿应用程序

碰撞技术如何运作?

在 Objective-C 中在 iPhone 上使用 HTTP POST 和 GET 的教程

如何使用 Cocoa 创建临时文件?

增加推送通知徽章 iPhone

仅替换 NSString 中子字符串的第一个实例

你如何安排一个块在下一次运行循环迭代中运行?

实现 -hash / -isEqual: / -isEqualTo...: 用于 Objective-C 集合

使用情节提要的条件转场

委托如何在 Objective-C 中工作?

Objective-C:前向类声明

如何推送两个视图控制器但只为第二个设置动画过渡?

从 URL Objective C 获取图像

Objective-C 异常

iOS中的活动生命周期相当于什么?