0

I am trying to import prepopulated Core Data Stack to my app and load its values to the console. I couldn't find a solution for it.

Can you help me with this ?

Here is the GitHub project of Example App.

https://github.com/herotheone/cURL2

Best Regards

Emin Turk
  • 350
  • 3
  • 13
  • 1
    Is it duplicate for [question](https://stackoverflow.com/questions/2230354/any-way-to-pre-populate-core-data)? – ezaji Sep 16 '18 at 15:25
  • Yeah but i'cant get the right answer that i am looking for. Thanks for the info – Emin Turk Sep 16 '18 at 15:52
  • Possible duplicate of [Any way to pre populate core data?](https://stackoverflow.com/questions/2230354/any-way-to-pre-populate-core-data) –  Feb 01 '19 at 08:26

1 Answers1

0

Well not sure if this is what you're looking for. But this could work too, at least it did for me.

Well as the story goes there was a client that wanted the app to start with a given set of data. Usage of CoreData was not a requirement though, but I wanted to learn it out of desperation(as it had already cost me a couple of jobs).

So here's what I did. I loaded up the SQLite with the data that client wanted and on first launch of the app I simply accessed those values from SQLite DB and updated my CoreData with it. From then onward I just referred to the CoreData.

A hack or even an unnecessary added step, i know, but it did get the job done.

Though at the end of it I would just say use an SQLite DB if you want pre-populated data.

Hope it helps. Feel free to ask if you have further questions.

iOSer
  • 2,241
  • 1
  • 18
  • 26