![](/img/trans.png)
[英]Bundle.main.path(forResource:ofType:inDirectory:) returns nil
[英]Bundle.main.path(forResource:ofType:inDirectory:) returns nil when directory and filename are correct
let audioPath = Bundle.main.path(forResource: songs[indexPath.row], ofType: ".mp3", inDirectory: "Songs")!
返回nil。 songs [indexPath.row]返回正確的名稱,因為它恰好位於名為“ Songs”的文件夾中。 歌曲文件夾為藍色,並在我的構建階段->復制捆綁資源中正確顯示
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.