【发布时间】:2023-03-31 23:25:01
【问题描述】:
我正在我的 iOS 应用程序上进行文件共享,我是 UIDocumentPickerViewController 的新手。我不知道为什么我的应用程序崩溃了。
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentPicker animated:YES completion:nil];
应用程序在突出显示的行上崩溃。
以前有人做过吗?我也想像下面的附件
【问题讨论】:
-
请显示崩溃线程的堆栈跟踪。
-
[UIDocumentPickerViewController _commonInitWithCompletion:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UIDocumentPickerViewController.m:66 2015-03-27 17:40:24.282 DocPick[3285:73604] *** 终止应用程序由于未捕获的异常“NSInternalInconsistencyException”,原因:“应用程序初始化文档选择器缺少 iCloud 权利。 com.apple.developer.icloud-container-identifiers 设置了吗? *** 首先抛出调用栈:
标签: ios xcode icloud icloud-drive uidocumentpickervc