I’ve gotten a lot from the book, but one item not found is how to import records into a Core Data-created SQLite database. I tried online for help, but I’m at a loss.
As I understand it…
Using SQLite directly (that is, not using Core Data at all) is not the preferred approach. From one site, I gather that Apple has taken related materials off their site that covered this. Instead, they want us to use Core Data
If we use Core Data, there is apparently no way (other than ‘hacking’) to get existing data into a database. We are not supposed to access Core Data’s .sqlite dbase directly and we are not supposed to use ‘hacking’ options
So how can a database be pre-populated with numerous records given the above constraints?
I am looking for something that…
- is not a hack
- agrees with Apple’s guidelines (that is, I’m not interested in methods that are not recommended by Apple and may stop working sometime in the future)
- allows the importing of hundreds of records into the database before the app is sent to the app store
- does not require that I already have the data in a ‘Core Data compliant’ database (if I could figure that out, I wouldn’t need help!)
- will allow records to actually reside in the database from which they are called…and not have to be read in every time the app starts up
- FYI - the records do not need to be editable by users (no changes or deletes are allowed in this app)
I’ve tried everywhere and can’t find an answer. Can someone please help? Any thoughts at all would be appreciated.