用第三方程序打开自己应用里的文档
2015-09-24 20:15
330 查看
如题,在三方中打开自己的文档
- (void)butClick:(UIButton *)sender { NSString * docPath = [[NSBundle mainBundle]pathForResource:@"1" ofType:@"rtf"]; NSURL * url = [NSURL URLWithString:docPath]; // 需要用三方程序打开的文件位置 UIDocumentInteractionController * interactionController = [UIDocumentInteractionController interactionControllerWithURL:url]; // 文件的类型,详情请参考官方文档 https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html interactionController.UTI = @"public.rtf"; // 打开方式,有几种 [interactionController presentOpenInMenuFromRect:sender.frame inView:self.view animated:YES]; }
相关文章推荐
- Map、Set、List、Queue、Stack的特点与用法2
- 把一个类存放在硬盘,并通过代码读取类的信息,输出到屏幕上
- 白话经典算法系列之十六 “基数排序”之数组中缺失的数字
- ORA-65096 invalid common user or role name
- index invisible与unusable 特性
- 【程序员养生】:养护肾脏
- iOS开发常用的代码
- C++四种类型转换
- UIWindow
- 磁盘 分区
- Map、Set、List、Queue、Stack的特点与用法1
- 复制一个文件
- 扫描由元组组成列表
- 【Linux】用grep在文档中查找内容
- MAHOUT文本向量相似度计算
- 将内容追加到文件尾部-采用字符流的形式,将abc.txt中的内容更换为 好好学习,天天向上!
- sitemesh性能测试结果比较惊艳
- 策略模式(Strategy)
- 杭电acm--2050
- 如何实现网页在线咨询框架