NSDocumentDirectory files disappear in ios

萝らか妹 提交于 2019-12-05 17:48:21

This is because in iOS 8 + the name of the Application folder is renamed each time you launch it.

Check it in /Users/"your username"/Library/Developer/CoreSimulator/Devices/"device name"/data/Containers/Data/Application/"application name" (Test in simulator).

So, you have to save the path without the document directory. And when you are trying to retrieve the path you have to add the document directory before the path you saved previously.

Like let your custom folder name is "Save_Video" and file name is "video_01.mp4". Your file saving path will be "Application document directory"/Save_Video/video_01.mp4

Then you have to store only "Save_Video/video_01.mp4"(in Database/ NSUserDefaults) and when you are retrieving the file the path should be

"Application document directory"/Save_Video/video_01.mp4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!