我正在使用 UIDocumentPickerViewController 来挑选文档。以下是指定的尿路感染:
NSArray *types = @[(NSString*)kUTTypeImage,(NSString*)kUTTypeSpreadsheet,(NSString*)kUTTypePresentation,(NSString*)kUTTypePDF,(NSString*)kUTTypeRTF,(NSString*)kUTTypePlainText,(NSString*)kUTTypeText];
UIDocumentPickerViewController *dpvc = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:types inMode:UIDocumentPickerModeImport];
从页面应用程序(页面文件)创建的文件显示为灰色,无法选择。但是 WhatsApp 文档选择器允许选择相同的文件。我错过了任何必需的 UTI 吗?
我的应用程序:
WhatsApp:
更新
com.apple.iwork.pages.sffpages 对我设备上的页面文件有效,但对 icloud 驱动器上的文件无效。呈现文档选择器的完整代码是:
-(IBAction)showDocumentPicker:(id)sender
{
NSArray *types = @[(NSString*)kUTTypeImage,(NSString*)kUTTypeSpreadsheet,(NSString*)kUTTypePresentation,(NSString*)kUTTypePDF,(NSString*)kUTTypeRTF,(NSString*)kUTTypePlainText,(NSString*)kUTTypeText, @"com.apple.iwork.pages.sffpages"];
UIDocumentPickerViewController *dpvc = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:types inMode:UIDocumentPickerModeImport];
dpvc.delegate = self;
//colorFromHex 4285f4
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:66.0/255.0 green:133.0/255.0 blue:244.0/255.0 alpha:1.0]];
[self presentViewController:dpvc animated:YES completion:nil];
}