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

标题: ios - iCloud 文档选择器 : App folders are disabled on import [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 12:39
标题: ios - iCloud 文档选择器 : App folders are disabled on import

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

My App iCloud import

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

Google Drive iCloud import

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

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

My info.plist

代码:

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

documentPicker.delegate = self;

documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;

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



Best Answer-推荐答案


你需要在 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];

关于ios - iCloud 文档选择器 : App folders are disabled on import,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34306818/






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