开发者

Pre-Loading, Prepopulating, Imprting data to existing CoreData store (SQLite)

I am in front of following problem: I have a CoreData based IPhone app, which I already have prepopulated by adding a sqlite-db to the resources folder and copy it to the documents folder if not already there. BUT: When I have to update the app and added a new SQLite db and the user already has a populated db in his document folder, how can I import the new data of the entity-tables into the existing db in the users document folder?

I found several threads about how to populate a db when the users-db is not already existing. I also found a lot about migrating, but that only changes the datastructure, but do not import new data from my db which I added to the resources folder.

How can I solve this problem?

开发者_开发技巧

Thanks for your help!

Philipp


The framework used to migrate the sqlite schema can also be used to load/migrate data during an app upgrade. I believe you'd need to use NSMigrationManager to manage the migration and to load additional data.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜