之前写的一个项目打开文件直接用的UIWebView,word、excel、tex等等打开很方便。这次写项目用到了UIDocumentInteractionController,这是IOS提供的使用其他程序打开你的App不支持的文件格式。
UIDocumentInteractionController *documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:url]];
[documentInteractionController setDelegate:[FileOpenTool sharedInstance]];
BOOL canShow = [documentInteractionController presentPreviewAnimated:YES];