gpt4 book ai didi

ios - 应用程序尝试在打印前使用 UIModalTransitionStyleCoverVertical 以外的过渡样式呈现内部弹出窗口

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:38:11 25 4
gpt4 key购买 nike

我正在尝试从 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,我会收到此错误消息:

Application tried to present inside popover with transition style other than UIModalTransitionStyleCoverVertical

然后应用程序崩溃了。当然,我明白了,但是我应该将这个转换应用于哪个 View Controller ?我无法控制显示打印对话框的弹出窗口...

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

谁能帮帮我?

谢谢法比奥

最佳答案

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

在我的旧机器上,我有 Xcode 5.1.1,当从那里运行时,出现了同样的问题,以及这个 View 中的更多问题(比如从右上角打开时无法关闭邮件 Controller )。

关于ios - 应用程序尝试在打印前使用 UIModalTransitionStyleCoverVertical 以外的过渡样式呈现内部弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25947910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com