应用程序尝试在打印之前使用除UIModalTransitionStyleCoverVertical之外的过渡样式显示内部弹出窗口

时间:2014-09-20 10:43:34

标签: ios ipad popover preview airprint

我正在尝试从iPad 8.x应用程序中打印txt文件。所以,我有这个代码:

- (void)onOpenWith:(UIButton *)theButton path:(NSString *)path
{


    NSURL *URL = [NSURL fileURLWithPath:path];

    if (URL) {



        self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];

        self.documentInteractionController.delegate = self;
        [self.documentInteractionController presentPreviewAnimated:YES];

    }
}

#pragma mark - UIDocumentInteractionControllerDelegate

- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
{
    return self;
}

- (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
{
    return self.view;
}

- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
{
    return self.view.frame;
}

现在一切都按预期进行,我看到了文件的预览,然后我触摸了屏幕右上角的图标,我可以在那些可以处理它的应用程序中共享文档。但是,如果我触摸PRINT,我会收到以下错误消息:

  

应用程序尝试使用过渡样式显示内部弹出窗口   除了UIModalTransitionStyleCoverVertical

并且应用程序崩溃了。当然,我理解它,但是我应该将视图转换应用于哪种转换?我无法控制弹出窗口显示打印对话框...

在iOS 7(真正的iPad不是模拟器)中一切正常......

有人能帮助我吗?

由于 法比奥

1 个答案:

答案 0 :(得分:0)

我也遇到过这个问题,解决方法是我必须在安装了Xcode 6的情况下构建并运行我的应用程序。

在我的旧机器上,我有Xcode 5.1.1,当从那里运行时,出现了同样的问题,并且从这个视图中出现了一些问题(比如从右上角打开时无法解除邮件控制器)。