UIDocumentInteractionControllerユーザーが からファイルを選択したときに、ナビゲーション コントローラーからを表示しようとしていますtableView。
はinteractionControllerWithURLNO を返し、デリゲート メソッドdocumentInteractionControllerViewControllerForPreviewは呼び出されず、documentInteractionコントローラーは表示されません。
ユーザーがテーブル内の項目を選択すると、次のコードが実行されます。
NSURL *fileURL;
fileURL = (NSURL *)[[DataMng sharedMng] getFileInFolder:self.navigationItem.title atRow:indexPath.row type:type];
if (self.docInteractionController == nil){
self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
if (!self.docInteractionController) {
NSLog(@"Selected a file with estension not supported for visualization");
return;
}
self.docInteractionController.delegate = self;
}else{
self.docInteractionController.URL = fileURL;
}
if(! [self.docInteractionController presentPreviewAnimated:YES]){
NSLog(@"ERROR in presenting preview");
}
デリゲート コントローラー (自己) はプロトコルに準拠しUIDocumentInteractionControllerDelegate、コントローラー内のナビゲーション コントローラーTabbarです。
どんなアイデアでも大歓迎です