ファイルを他のアプリに送信するために UIDocumentInteractionController を実装しました。ファイルは .txt ファイルです。
コードは次のとおりです。
UIDocumentInteractionController *interactionController = [[UIDocumentInteractionController alloc] init];
[interactionController setURL:[NSURL fileURLWithPath:filePath]];
[interactionController setUTI:@"public.text"];
[interactionController setDelegate:self];
[interactionController presentOpenInMenuFromBarButtonItem:actionBarButtonItem animated:YES];
メニューは正常に開き、Pages や Dropbox などのアプリが期待どおりに表示されます。しかし、それらの 1 つをタップすると、[開く] メニューが閉じられ、アクションは実行されません (ファイルは送信されず、ターゲット アプリケーションは開きません。
オプションメニューを使用してデリゲートメソッドdocumentInteractionController:canPerformAction:
を実装し、 documentInteractionController:performAction:
copy: および print: 呼び出しをトリガーしようとしました (メニューで開くのではなく)。
これはどのように解決できますか?