gpt4 book ai didi

ios - UIDocumentInteractionController presentOptionsMenuFromBarButtonItem 不打开应用程序

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

我使用 UIDocumentInteractionController presentOptionsMenuFromBarButtonItem 在 Adob​​e Reader 应用程序中打开 PDF,使用邮件发送并打印。邮件和打印工作正常,但我无法打开任何其他应用程序。我尝试了 presentOpenInMenuFromBarButtonItem 和 UIActivityViewController,但它们都不能满足我的需要。

我尝试使用 documentInteractionController: willBeginSendingToApplication: delegate 打开 Adob​​e Reader,但我无法找到如何将 pdf 传递到应用程序。可能吗?

如果没有,是否有另一种方法可以在 Adob​​e Reader 应用程序中打开 PDF,使用 Mail 发送并打印?

谢谢

最佳答案

通常我是这样的:

   NSURL *documentsDirectoryPath = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]];

NSURL *URL =[documentsDirectoryPath URLByAppendingPathComponent:@"your pdf"];

UIButton *button = (UIButton *)nil;
self.documentInteractionController.delegate=self;
if (URL) {
// Initialize Document Interaction Controller
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
// Configure Document Interaction Controller
[self.documentInteractionController setDelegate:self];
//preview
[self.documentInteractionController presentPreviewAnimated:YES];
// Present Open In Menu
[self.documentInteractionController presentOpenInMenuFromRect:[button frame] inView:self.view animated:YES];

}

关于ios - UIDocumentInteractionController presentOptionsMenuFromBarButtonItem 不打开应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33156525/

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