我正在尝试使用 iOS 14 initForOpeningContentTypes:而不是已弃用的initWithDocumentTypes:inMode:,并且我无法访问带有扩展名的文件p8(它们是灰色的)。
我正在尝试以下代码:
NSArray<UTType*> * contentTypes = @[[UTType typeWithFilenameExtension: @"p8"
conformingToType: UTTypeData]];
UIDocumentPickerViewController *documentPicker = nil;
documentPicker = [[UIDocumentPickerViewController alloc] initForOpeningContentTypes: contentTypes];
选择器启动,但文件“myfile.p8”显示为灰色且无法选择。我在这里做错了什么?