Play local audio file with AVAudioPlayer

后端 未结 4 1920
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 07:51

I\'m testing my app in simulator.

I\'m downloading file and getting it\'s local way like this one: file:///Users/administrator/Library/Developer/CoreSimulator/

4条回答
  •  我在风中等你
    2020-12-19 08:22

    Under iOS8, the path that you have saved won't be valid across launches. The id you see "E5F13797-A6A8-48A1-B3C3-FBC3D7A03151" will change with each launch.

    The solution is to save the filename and not the complete path, and to recreate the URL or complete path, by getting the path to the Documents (or tmp) folder and appending the filename to it.

提交回复
热议问题