How to put a Property List in the Documents folder of my app when app is shipped?

落花浮王杯 提交于 2019-12-25 00:08:19

问题


I have several tableviews in my app and the data source for each tableview is a property list. Currently I have the propertylists saved in the application bundle. However, thats only because I created them in XCode and they are automatically saved in the documents folder. This is fine as when the app ships, thats where they need to be.

However, I would like to put a copy of the property lists in the documents folder of my app as well when it ships. How can I do that? I mean Can I program XCode to save the pLists I create manually to save in the documents folder of my app? Or how does that work? Basically to summarize, I would like to put a copy of the propertylist each in the application bundle and the documents folder

I appreciate any help anyone provides.

Thanks


回答1:


You can't. You would have to copy the file over when the app is first run, either by detecting that the file doesn't exist or by checking a flag in NSUserDefaults.



来源:https://stackoverflow.com/questions/5413130/how-to-put-a-property-list-in-the-documents-folder-of-my-app-when-app-is-shipped

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