OGeek|极客世界-中国程序员成长平台

标题: iphone - 在我的应用程序中打开(xlsx,ppt,pptx.docx)从 safari 或邮件不起作用 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 23:41
标题: iphone - 在我的应用程序中打开(xlsx,ppt,pptx.docx)从 safari 或邮件不起作用

我正在使用 iOS 5.1 sdk 开发我的应用程序,但“打开方式”不适用于 pptx、ppt、docx、xlsx。有人可以给我 info.plist 的设置吗?我使用 com.microsoft.word.doc、com.microsoft.excel.xls、com.microsoft.powerpoint.ppt 作为文档类型。

CFBundleTypeIconFiles CFBundleTypeName Microsoft PowerPoint 演示文稿 CFBundleTypeRole Viewer LSHandlerRank Alternate LSItemContentTypes com.microsoft.powerpoint.​ppt com.microsoft.powerpoint.​pptx CFBundleTypeIconFiles CFBundleTypeName Excel 文档 CFBundleTypeRole Viewer LSHandlerRank Alternate LSItemContentTypes com.microsoft.excel.xls com.microsoft.excel .xlsx



Best Answer-推荐答案


NSArray *extensionArray = [NSArray arrayWithObjects"doc", @"docx", @"ppt", @"pptx", @"xls", @"xlsx",@"mp3",@"mp4",@"rft",@"rtf",@"pages",@"key",@"numbers",nil];

   for (int i=0; i<[extensionArray count]; i++) {
       NSString *fileExtension = [extensionArray objectAtIndex:i];
       NSString *utiString = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,(__bridge CFStringRef)fileExtension,NULL);
       NSLog(@"Extension: %@ UTI:%@",fileExtension,utiString);
   }

我们可以使用此代码打印正确的 UTI。

关于iphone - 在我的应用程序中打开(xlsx,ppt,pptx.docx)从 safari 或邮件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13234928/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4