0

Upto now i was using sqlite. I have an app which list a group of products. Each product have product name,sku number,price & description.

These are different categories which are main prodcuts,accessory products & add-on products.

I created 3 tables for these groups in sqlite. I can able to fetch data from each table as well. Each table have more than 20000 records/rows of data.

Now I want to use core data. I can create 3 entities for these 3 tables,But I cannot enter that much data manually.

Problem- How can i populate data in coredata store (sqlite)?

Please help me.

Note: Even I have update feature in app that downloads latest db from server and will replace existing db. As I mentioned I sqlite file which I am using currently is different than what core data creates so how can i update coredata sqlite db as well.

Community
  • 1
  • 1
Naresh G
  • 117
  • 1
  • 10

1 Answers1

2

You can write a function which will store your data in core data store. Just execute the function on first launch of your app. You can store a boolean in NSUserDefaults to check if it's first launch or not.

bisma
  • 795
  • 6
  • 26
  • Hi bisma thanks for your reply. I did that but it's taking so much time. I am fetching data from my existing sqlite db and inserting into coredata generated sqlite DB. It's taking so much time for 25000 records. It causes performance issues. – Naresh G Dec 29 '16 at 03:58