开发者

Does updating your application delete files?

开发者 https://www.devze.com 2023-02-06 19:21 出处:网络
I wrote a game that I plan on updating soon. The game generates a scoreboard when the a开发者_开发百科pplication starts, if there is no scoreboard file present.

I wrote a game that I plan on updating soon. The game generates a scoreboard when the a开发者_开发百科pplication starts, if there is no scoreboard file present.

If people update to my latest version, will the scoreboard file (that's generated by the code itself, not a file that comes preloaded in the app) be deleted?

If so, is there any way to avoid this without any coding previously required?


The updated version of your app will simply replace the existing version's bundle - any files you've written to your app's document area will remain intact.

As such, you simply need to check for the presence of the file within your app's document area as per usual and write a "new" version if none exists.


If the file is within your applications bundle, it will be deleted. Files saved with Core Data and NSUserDefaults will not. I've never personally written a file to the disk, so I don't know where the default write point is. You'll have to find this out yourself.

Happy coding,

Zane

0

精彩评论

暂无评论...
验证码 换一张
取 消