Bundle.main.path(forResource:ofType:inDirectory:) returns nil

后端 未结 10 2399
遥遥无期
遥遥无期 2020-12-07 13:08

Try not to laugh or cry -- I\'m just getting back into coding after 20 years out...

I\'ve spent more than 4 hours looking at references and trying code snippets to g

10条回答
  •  有刺的猬
    2020-12-07 13:36

    I think you don't want the inDirectory: method. Try this instead:

    if let filepath = Bundle.main.path(forResource: "newTest", ofType: "txt") {
    

提交回复
热议问题