您的位置:首页 > 其它

用第三方程序打开自己应用里的文档

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];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: