2014-01-30 119 views
7

我正在通過UIDocumentInteractionController與其他應用程序共享PDF。在添加此功能之前,我使用了MFMailComposeViewController自定義的「發送到電子郵件」按鈕 - 但現在我的UIDocumentInteractionController中也有一個郵件按鈕,我想利用該按鈕來避免重複按鈕。通過UIDocumentInteractionController與郵件進行交互

我的問題是,通過舊的郵件控制器,我用來設置主題和內容文本,而如果我使用UIDocumentInteractionController - 我只收到一封帶有PDF附件的空白電子郵件。有沒有人知道我可以使用這種方法並在使用UIDocumentInteractionController時獲得我的自定義主題和內容?

我在文檔中找不到任何明顯的東西,顯然我不能干涉Mail應用程序以使其與我的應用程序進行通信 - 但是想知道是否有其他人遇到了問題,並且懷疑出現了「返回'門'的解決方案。

下面是我當前如何創建和initalising代碼我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]; 
} 
+0

你有沒有找到答案做到這一點? – windup

+0

@windup不幸的是 - 仍然沒有答案的問題! – Chris

回答

0

您可以通過下面的代碼

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

問題是關於設置郵件編輯器的屬性。 setName:將在導航欄中設置UIDocumentInteractionController的標題,而不是郵件主題。 –