开发者

Core Data with pre populated sqlite3 file

开发者 https://www.devze.com 2023-01-20 19:57 出处:网络
I\'m working on an iPhone app that uses NSURLConnection to down load files and then convert 开发者_开发百科those files into sqlite3 tables. I would like to use core data to store these tables and to c

I'm working on an iPhone app that uses NSURLConnection to down load files and then convert 开发者_开发百科those files into sqlite3 tables. I would like to use core data to store these tables and to create all the applicable objects. So, do I have to build the models of the data in XCode with the graphical tool representing all the table names and columns? I've been searching and found examples of apps that use core data and copy in a pre populated sqlite file for the default data. The data that I'm working with will have some variations in the table names and column name and types. Any direction would be appreciated.


You need to load the database via a Core Data model within a Core Data application. You can't use a sqlite database that was not created with Core Data (without a huge amount of unsupported pain).

Core Data databases created with applications on Mac OS X are compatible with Core Data applications on iOS. I know of a number of developers that have written little command line tools that run as a part of building their iOS application that effectively "compile" a database that is then copied into the application's app wrapper.

0

精彩评论

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

关注公众号