我正在使用iOS 5.1 sdk开发我的应用程序,但“Open In”不适用于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 Document CFBundleTypeRole Viewer LSHandlerRank Alternate LSItemContentTypes com.microsoft.excel.xls com.microsoft.excel .XLSX
答案 0 :(得分:4)
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。