IOS 怎么样调用其他应用程序打开本人下载好了的 EXCEL WORD PDF 等

iOS 码拜 9年前 (2015-11-12) 1450次浏览
IOS 怎么样调用其他应用程序打开本人下载好了的 EXCEL WORD PDF 等
IOS 怎么样调用其他应用程序打开本人下载好了的 EXCEL WORD PDF 等
这个是 QQ 邮箱的APP ,不知道怎么样实现的
解决方案:40分
documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
documentController.delegate = self;
documentController.UTI = @"com.microsoft.word.doc";
[documentController presentOpenInMenuFromRect:CGRectMake(760, 20, 100, 100) inView:self.view animated:YES];

其中filePath为你要打开的文件路径,
UTI可以去
https://developer.apple.com/library/mac/#documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html
根据filePath文件后缀名去动态设置


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明IOS 怎么样调用其他应用程序打开本人下载好了的 EXCEL WORD PDF 等
喜欢 (0)
[1034331897@qq.com]
分享 (0)