我正在尝试使用以下代码从应用程序文档目录中加载文件,但是,出现错误The folder “Documents” doesn’t exist.
。我在做错什么吗?
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
var documentsUrl = paths[0]
do {
let fileURLs = try FileManager.default.contentsOfDirectory(atPath: documentsUrl.absoluteString)
print(fileURLs)
} catch {
print(error.localizedDescription)
}