Hi, I am new to iOS app development. I have my sqlite database and I want to fetch records from it using Core Data. How is it possible? Can you provide me a simple tutorial? Thanks for your help!
Hi, I am new to iOS app development. I have my sqlite database and I want to fetch records from it using Core Data. How is it possible? Can you provide me a simple tutorial? Thanks for your help!
Short answer is that you cannot use core data to access sqlite. Core data is designed to work with data, not to work with a database.
That being said, you can use sqlite to upload data into a Managed Object and then use core data to access the data from there. You can do this by
1) Modeling your data in Xcode
2) Read each record from your database. For each record create a new Managed Object and using KVC set the values of your attributes.
It's really hard in the beginning, but once you get the hang of it, it's okay
(on the last page of that tutorial, it will teach you how to acces an already made SQLite database and use it
Thanks jnoxx for your reply, I successfully followed this tutorial and I was able to create my own example. Right now I want to create a sqlite database using core data, but this time I want to create multiple tables with relationships. Do you have a good tutorial for this? Thanks!