开发者

Packaging files in an iOS app for subdirectories of Library

开发者 https://www.devze.com 2023-02-01 21:20 出处:网络
I have a set of XML files that need to go into the app. I\'m thinking of making them user-modifiable, too, making them more like templates. In any case, they may change when the app is updated.

I have a set of XML files that need to go into the app. I'm thinking of making them user-modifiable, too, making them more like templates. In any case, they may change when the app is updated.

According to the iOS programming guide and the data type reference for NSSearchPathDirectory the place to put these files wo开发者_StackOverflow中文版uld be Library/Application Support.

The problem is I would only want these files copied in an app install or upgrade. An Xcode build phase didn't seem to cover the situation, although I'm pretty new to this.

The only thing i can really think of is to add a "placeholder file" and only run the install if this file is missing. Then on first install, I can programmatically copy the files from the resource bundle.

If there's a better way, I'd love to know.


For anyone who ends up here:

I did end up doing a simple check for existence; depending on how things go I may add either a checksum or a version number to check for modifications.

0

精彩评论

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

关注公众号