2

我在尝试从 iCloud 导入时遇到应用文件夹被禁用的问题,请参见下图:

我的应用 iCloud 导入

我检查了谷歌驱动器的 iCloud 导入,它没有被禁用,如下图所示:

谷歌云端硬盘 iCloud 导入

我需要从其他应用程序的文件夹中获取文档,我做错了什么?

这是我在 info.plist 中的当前设置:

我的信息.plist

代码:

UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] 
                  inMode:UIDocumentPickerModeImport];

documentPicker.delegate = self;

documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;

[self presentViewController:documentPicker animated:YES completion:nil];
4

1 回答 1

1

您需要在 UIDocumentPickerViewController 中添加 Utils

UIDocumentPickerViewController *picker=[[UIDocumentPickerViewController alloc] 
      initWithDocumentTypes: @[(__bridge NSString *) kUTTypeContent,
                               (__bridge NSString *) kUTTypeData,
                               (__bridge NSString *) kUTTypePackage,
                               (__bridge NSString *) kUTTypeDiskImage,
                               @"com.apple.iwork.pages.pages",
                               @"com.apple.iwork.numbers.numbers",
                               @"com.apple.iwork.keynote.key"] inMode:UIDocumentPickerModeImport];
于 2016-01-12T07:47:04.333 回答