UIDocumentPickerViewController代码在iOS 12中有效,但在iOS 13中失败

时间:2019-12-10 15:30:32

标签: objective-c ios13 presentviewcontroller uidocumentpickerviewcontroller

以下代码(位于“警报”的“确定”按钮内)在iOS 12上完美运行,但甚至无法打开“浏览窗口”。在iOS 13中根本没有任何反应。

*okAction = [UIAlertAction
                             actionWithTitle:@"Load File"
                             style:UIAlertActionStyleDefault
                             handler:^(UIAlertAction *action)
{

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

documentPicker.modalPresentationStyle = UIModalPresentationPopover;
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationPopover;
documentPicker.popoverPresentationController.sourceView = self.view;
[self presentViewController:documentPicker animated:YES completion:nil];
}];

任何建议将不胜感激!

0 个答案:

没有答案