UIDocumentInteractionController浏览文件
来源:互联网 发布:mac 更改ruby路径 编辑:程序博客网 时间:2024/06/06 02:38
之前写的一个项目打开文件直接用的UIWebView,word、excel、tex等等打开很方便。这次写项目用到了UIDocumentInteractionController,这是IOS提供的使用其他程序打开你的App不支持的文件格式。
UIDocumentInteractionController *documentInteractionController = [UIDocumentInteractionControllerinteractionControllerWithURL:[NSURLfileURLWithPath:url]];
[documentInteractionController setDelegate:[FileOpenToolsharedInstance]];
BOOL canShow = [documentInteractionControllerpresentPreviewAnimated:YES];
if (!canShow) {
// 无法打开的文件类型
AppDelegate *appDelegate = (AppDelegate *)[[UIApplicationsharedApplication] delegate];
UIViewController *rootVC = appDelegate.window.rootViewController;
[v presentOptionsMenuFromRect:CGRectZeroinView:rootVC.viewanimated:YES];
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{
// Do time-consuming task in background thread
// Return back to main thread to update UI
dispatch_sync(dispatch_get_main_queue(), ^{
// 浏览写在这里
});
});
bool _WebTryThreadLock(bool), 0x1556d49d0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...
1 0x187dd0f8c WebThreadLock
2 0x18929ea68 <redacted>
3 0x18927508c <redacted>
4 0x189274f64 <redacted>
5 0x189408f04 <redacted>
6 0x189049810 <redacted>
7 0x18905803c <redacted>
8 0x1892eb6c0 <redacted>
9 0x18905f4b4 <redacted>
10 0x18924a88c <redacted>
11 0x18936a244 <redacted>
12 0x18924a404 <redacted>
13 0x1892046cc <redacted>
14 0x18910fd28 <redacted>
15 0x18910fa04 <redacted>
16 0x18910f96c <redacted>
17 0x18904c0e4 <redacted>
18 0x1869f2a28 <redacted>
19 0x1869ed634 <redacted>
20 0x1869ed4f4 <redacted>
21 0x1869ecb24 <redacted>
22 0x1869ec86c <redacted>
23 0x186a1bc90 <redacted>
24 0x183b721e0 <redacted>
25 0x183b71d58 <redacted>
26 0x183b7153c pthread_mutex_lock
27 0x183b71020 start_wqthread
- UIDocumentInteractionController浏览文件
- UIDocumentInteractionController 文件预览
- UIDocumentInteractionController
- iOS 使用UIDocumentInteractionController类打开文件
- 文件查看之UIDocumentInteractionController和UIWebView.WKWebView
- (浏览文档)UIDocumentInteractionController打开自己的第三方应用、使用QLPreviewController浏览文档
- 下载文件 ,调用系统的方法(UIDocumentInteractionController) 查看
- UIDocumentInteractionController 第三方应用中打开自己的文件 方法
- UIDocumentInteractionController 第三方应用中打开自己的文件 方法
- iOS 调起第三方程序打开文件 ( UIDocumentInteractionController )
- 浏览文件
- 8. UIDocumentInteractionController
- iOS 第三方应用中打开自己的文件(UIDocumentInteractionController)
- chm文件无法浏览
- 使用explorer浏览文件
- 文件浏览对话框
- PE文件信息浏览
- Android 文件浏览控件
- nodejs学习记录(1)
- MongoDB Aggregation Pipeline
- 18、Dom--childNodes和nodeType的结合使用
- Android的ScrollView示例
- 设置MathType标签名称的方法
- UIDocumentInteractionController浏览文件
- bower
- poj1019 n的位数+规律
- 现代通讯类产品生产制造流程(二)
- discover meteor实例代码第9章关于session is no defined的处理
- 扫描指定目录下所有图片文件
- PowerPC介绍
- linux命令
- linux使用tcpdump抓包工具抓取网络数据包,多示例演示