Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kimbebot

macrumors newbie
Original poster
Jun 26, 2012
5
0
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!
 
You probably already know this (but just in case), Core Data is based on SQLite.

My understanding is that Core Data is a wrapper over SQLite, so it shouldn't be a problem except for data type conversions. I would guess that SQLite supports more types than are native to Core Data.

So I'm wondering, why use Core Data instead of SQLite?

I'm learning SQLite right now and have been useing this:
http://shop.oreilly.com/product/9780596521196.do
 
You don't use CoreData to "fetch data from a sqlite database". If you need to "fetch data from a sqlite database" you use FMDB or similar. :)

Using CoreData but thinking in SQL language only creates confusion. If you intent to use CoreData then better ignore the fact that CoreData is using a sqlite db as persistent storage and forget everything you know about sql language.

CoreData is an Object Graph framework not a database interface. It happens to store data to a sqlite db as default but from a programmer point of view the usage is in terms of objects not in terms of rows and tables.
 
You don't use CoreData to "fetch data from a sqlite database". If you need to "fetch data from a sqlite database" you use FMDB or similar. :)

Using CoreData but thinking in SQL language only creates confusion. If you intent to use CoreData then better ignore the fact that CoreData is using a sqlite db as persistent storage and forget everything you know about sql language.

CoreData is an Object Graph framework not a database interface. It happens to store data to a sqlite db as default but from a programmer point of view the usage is in terms of objects not in terms of rows and tables.

Listen to this guy - when you use CoreData, you have to forget about the underlying DB (which may or may not be SQLite - XML and in-memory stores are also available).

CoreData allows you to have millions of objects and to persist and query the object space.

If you want to interact with a SQLite DB directly, use SQLite.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.