-2

i am searching for 2 days on internet but i am not getting any solution that works for me i have a sqlite database with one thousand records now requirment is to use with core data problem is how to use this existing db with core data? core data creates its own db i tried to copy old db into app document dir but getting z_tables error i tried to search where this core data db is located in my os x lion but cant find it .. please help deadline is near

supera
  • 580
  • 5
  • 13

2 Answers2

1

The tables error occurs because of the difference in the structures or schema of the two tables.

Please go through this previous SO question to get a better idea Pre-load existing data into a Core Data-based iPhone app?

Community
  • 1
  • 1
visakh7
  • 26,380
  • 8
  • 55
  • 69
0

A fairly simple way to do this is to save your data in a plist file, organized as an array of dictionaries - then at launch check if the Core Data database has any records, and if not read in the plist file and populate the database.

You'll need a plist file for every table, so this is most viable for simple databases.

Monolo
  • 18,205
  • 17
  • 69
  • 103