如何在appstore中更新预填充的Core Data(SQLITE3)DB [英] How to update a pre-populated Core Data (SQLITE3) DB in appstore

查看:361
本文介绍了如何在appstore中更新预填充的Core Data(SQLITE3)DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,除了我想解决的问题,在这个问题。我一直在问这个问题,但我想问了错误的问题,所以我给它一个新的去。对于我开始了这一步,我深表歉意:刷新SQLITE3(核心



再次,我不是要求写入数据库,但刷新整个,



这是顺序:



  1. 我在模拟器中运行应用程序,数据库位于文档目录中


  2. 键入魔术密码它不会在应用商店代码中提供)



    a。该应用会删除数据库中的所有记录



    b。从.txt文件读取新的/更新的数据并填充数据库


  3. 在模拟器中继续或重新启动应用程序, / p>

  4. 附上测试装置,并安装应用程式并执行建立



    a。所有基于代码的更改都会在模拟器中反映和运行



    b。数据库未更新并仍显示旧数据,未安装更新(2b)



这里是问题,我想通过重建更新数据库,但只有在模拟器中工作。我知道我可以通过一个网站或类似的,但这不是我试图解决这里。



我读某处的文档目录中的数据保存在构建,是真的吗?



我想一个场景是在构建和添加.txt文件中的应用程序中找到新的.txt文件时更新数据库。



有人可以给绝望的人一些建议,也许一些例子我应该怎么做这样更新的数据库也分布在构建?



==== SOLVED ====


经过大量测试后,我决定搬家.txt文件到捆绑包中,并在手机中更新,而不是移动sqlite3数据库。



解决方案

文档目录内容不以任何方式与构建连接。
要进行此工作,应将数据库复制到项目文件夹并将其添加到项目中。从那时起,它将被复制到您的设备。


I have an application that is finished except for the problem i am trying to fix in this question. I have been asking about this before but i guess asked the wrong question so i give it a new go. I do apologize that i have started this tread: refresh SQLITE3 (Core Data) on device and app store and ask again but i am desperate.

Again, i am not asking about writing into the database but refresh the whole, pre-populated, database at build time.

Here is the sequence:

  1. I run the application in the simulator, the DB is located in the documents directory

  2. Type the magic password (which will not be available in the app store code)

    a. The app deletes all records in the DB

    b. Read new/updated data from .txt file and populate the database

  3. Continue or restart the app in the simulator, the DB is updated with new/updated data

  4. Attach my test device, with the app already installed and run a build

    a. All code based changes is reflected and works as in the simulator

    b. The DB is not updated and still shows the "old" data, the updates (2b) is not installed

Here is the problem, i want to update the database via the rebuild but that only works in the simulator. I know i can probably do it via a website or similar but that is not what i try to solve here.

I read somewhere that data in the documents directory is kept at build, is that true?

I guess one scenario is to add the .txt files in the build and update the DB in the app when finding the new .txt file.

Can someone nice give a desperate man some advice and maybe some examples how i should do this so the updated database is also distributed at the build?

====SOLVED====

After a lot of testing i decided to move in the .txt files into the bundle and do the update in the phone rather than moving the sqlite3 DB.

解决方案

Documents directory contents are not connected with build in any way. To make that work, you should copy database to your project folder and add it to your project. Since then it will be copied to your device.

这篇关于如何在appstore中更新预填充的Core Data(SQLITE3)DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆