在 Xcode 12.5.1 中使用 IOS 14.5 部署目标遵循 UIDocumentPickerViewController 的现场 IOS 文档时,出现错误:
Incorrect argument label in call (have 'forOpeningContentTypes:', expected 'forExporting:')
关于现在应该如何使用 IOS UIDocumentPickerViewController 有什么建议吗?
我的代码除了:
// Create a document picker for directories.
let documentPicker =
UIDocumentPickerViewController(forOpeningContentTypes: [.folder])
documentPicker.delegate = self
错误快照:
有关如何使用文档选择器的文档:
https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories给出:
最佳答案
你忘了
import UniformTypeIdentifiers
关于ios - 如何初始化 UIDocumentPickerViewController 注意到 "forOpeningContentTypes"(来自 doco)似乎在 IOS 中已被弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68810300/