填充由CoreData创建的sqlite数据库 [英] Populating sqlite db created by CoreData
问题描述
我有一个由我的CoreData模型自动创建的sqlite数据库,但我的应用程序不会给用户写入数据的能力,而是我想要预先填充程序需要的所有数据。我的问题是,CoreData创建的sqlite数据库有未知的表和字段,在我的模型中不存在。有没有反正我可以填充自动创建的数据库用sqlite创建,然后使用CoreData读取它?
I have a sqlite DB created by my CoreData model automatically, but my app will not give the user the ability to write data into it, instead I wanted to pre-populate it with all the data the program needs. My problem is that the sqlite DB created by CoreData has unknow tables and fields that where not present in my model. Is there anyway I can populate the DB created automatically with sqlite and only then use CoreData to read it?
推荐答案
sqlite存储创建由Core Data不应该直接编辑。 使用Core Data填充它。
The sqlite store created by Core Data should not be edited directly. Use Core Data to populate it.
这篇关于填充由CoreData创建的sqlite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!