Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load data into Core Data?

thanks for you help.

I'm attempting to add core data to my project and I'm stuck at where and how to add the actual data into the persistent store (I'm assuming this is the place for the raw data).

I will have 1000 < objects so I don't want to use a plist approach. From my searches, there seems to be xml and csv approaches. Is there a way I can use SQL for input?

The data will not be changed by the user and the data file will be typed in by hand, so I won't need to update these files during runtime, and at this point I am not limited in any type of file - the lightest on syntax is preferred.

Thanks again for any help.

like image 241
Ernest Avatar asked Feb 28 '26 12:02

Ernest


1 Answers

You could load your data from an xml/csv/json file and create the DB on the first lunch of your application (if the DB is not there, then read the data and create it). A better/faster approach might be to ship your sqllite DB within your application. You can parse the file in any format you want on the simulator, create a DB with all your entities, then take it from the ApplicationData and just add it to your app as a resource.

like image 152
elibud Avatar answered Mar 02 '26 02:03

elibud