###前提・実現したいこと
UIDocumentInteractionControllerを使ってファイルの共有をしていたのですがiOS11の端末で実行してみたところファイルの共有ができなくなっていました。iOS9の端末では共有できていることを確認しました。(iOS10は未確認です。)
コードは下記のようなものです。
原因はdocInteractionControllerが破棄されたいたからのようでdocInteractionControllerをインスタンス変数にすることでファイル共有ができるようになったのですが、このdocInteractionControllerはどのタイミングで破棄すればいいのでしょうか?
###該当のソースコード
@implementation ViewController - (IBAction)tappedButton:(UIButton *)button { NSString *filePath = ファイルパス...; NSURL *url = [NSURL fileURLWithPath:filePath]; UIDocumentInteractionController *docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url]; docInteractionController.delegate = self; BOOL result = [docInteractionController presentOptionsMenuFromRect:button.frame inView:self.view animated:YES]; if (!result){ // アラート表示... } }
###補足情報(言語/FW/ツール等のバージョンなど)
環境Xcode9.0
言語Objective-C
回答1件
あなたの回答
tips
プレビュー