【问题标题】:Interact with Mail though UIDocumentInteractionController通过 UIDocumentInteractionController 与 Mail 交互
【发布时间】:2014-02-22 19:02:15
【问题描述】:

我正在通过UIDocumentInteractionController 与其他应用程序共享 PDF。在添加此功能之前,我有一个使用 MFMailComposeViewController 的自定义“发送到电子邮件”按钮 - 但现在我的 UIDocumentInteractionController 中还有一个邮件按钮,我想使用它来避免重复按钮.

我的问题是,通过旧的邮件控制器,我曾经设置主题和内容文本,而如果我使用 UIDocumentInteractionController - 我只会收到一封带有 PDF 附件的空白电子邮件。有谁知道我可以解决这个问题并在使用UIDocumentInteractionController 时获取我的自定义主题和内容?

我在文档中找不到任何明显的内容,显然我无法干预 Mail 应用程序以使其与我的应用程序通信 - 但想知道是否有其他人遇到过这个问题,并提出了一个“后退-门的解决方案。

下面是我当前如何创建和初始化我的UIDocumentInteractionController 的代码:

-(void)openDocumentIn:(NSString*)filepath
{

    //NSString * filePath = [[NSBundle mainBundle] 
                                  pathForResource:filePath ofType:@"pdf"];
    documentController = [UIDocumentInteractionController 
                         interactionControllerWithURL:[NSURL fileURLWithPath:filepath]];
    documentController.delegate = self;
    documentController.UTI = @"com.adobe.pdf";
    [documentController presentOptionsMenuFromBarButtonItem:
         [self.imageViewController exportQuote] animated:YES];
}

【问题讨论】:

  • 你找到答案了吗?
  • @windup 很遗憾没有 - 仍然是一个悬而未决的问题!

标签: ios cocoa-touch ios7 uidocumentinteraction


【解决方案1】:

你可以通过以下代码做到这一点

[self.documentInteractionController setName:@"My Email Subject"];

【讨论】:

  • 问题是关于设置邮件作曲家的属性。 setName:将在导航栏中设置 UIDocumentInteractionController 的标题,而不是邮件的主题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-27
  • 2020-01-21
  • 2017-02-12
  • 2019-06-25
  • 2021-07-14
  • 1970-01-01
相关资源
最近更新 更多