iPhone - copying a file from resources to Documents gives an error

后端 未结 3 1349
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 16:42

I am trying to copy an mp3 file from my Resources folder to a folder inside \"Documents\" folder of the app. On the simulator this works fine. But when I run it on a device,

3条回答
  •  独厮守ぢ
    2020-12-05 17:03

    That's the NSFileWriteNoPermissionError:

    http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html

    Somehow, you do have the wrong path and it's not letting you write there. You could also delete the app and try again, in case somehow your app documents directory was set to the wrong permissions...

    I'd give us the line of code doing the copy, and print outs of each variable used in that line. Then we can see what the problem is.

提交回复
热议问题