当我尝试使用以下代码访问项目中的文件时,我不断获取nil路径:
let path: String
if let pathOfFile = Bundle.main.path(forResource: "comfortJH", ofType: "csv")
{
path = pathOfFile
}
let stream = InputStream(fileAtPath: path)
I have checked my target memberships for the file.
I have also checked that it appears in "Copy Bundle Resources".
为什么会这样?