iOS应用程序更新,如何更新bundle中的plist?
有没有办法通过 iTunes 应用程序更新来更新捆绑包中已修改的 plist 文件?
我有一个应用程序,它以数组和数组的形式将一些数据存储在 plist 文件中。字典。在某些更新中,我在 plist 文件中添加了更多数组项,但似乎更新应用程序时,不会复制/更新新的 plist 文件,除非用户删除应用程序并重新安装它。
如何让应用程序使用新的 plist 文件更新本地副本?
Is there a way to update a modified plist file that's in the bundle through an iTunes app update?
I have an app that stores some data in a plist file in the form of an array & dictionaries. On some updates I have added to the plist file with more array items, but it seems that when the app is updated, the new plist file isn't copied/updated over unless the user deletes the app and re-installs it.
How do I get the app to update the local copy of the plist file with the new one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您无法更新捆绑包中的任何内容。如果您希望能够更新,请将 plist 保存在文档目录中。
使用商店更新应用程序时,文档目录中的文件不会被删除。
You can't update anything that's part of the bundle. Save the plist in the documents directory if you want to be able to update it.
Files in the documents directory don't get deleted when updating an app using the store.
版本控制的 .plist 文件?例如
MyApp-YYYYMMdd.plist
Versioned .plist files? E.g.
MyApp-YYYYMMdd.plist
我在应用程序中遇到了类似的问题。我要做的就是,当应用程序在应用程序委托中收到 willEnterForeground 通知时,检查应用程序是否已加载旧版本或新版本的 plist 文件,然后从包中加载新文件并将其保存到文档中目录。
I had a similar issue in an app. What I did to address is it check whether the app has loaded the old or the new version of the plist file when the app gets the willEnterForeground notification in the app delegate, and then load the new file from the bundle and save it to the documents directory.