Possible Duplicate:
Core Data vs SQLite 3
I have been using SQLite for saving data in my iOS application (for a table with over 20,000 rows max). However, I’ve encountered a problem with SQLite, where, when I try to use a SELECT statement while I insert data to the table, the SELECT statement won’t work.
Would something like this work in Core Data? Can I retrieve data from the database at the same time as I insert new data into it?
Yes, you can do queries and inserts on Core Data at the same time, which I assume you’ll want to do on multiple threads. The best way to do this is to have an NSManagedObjectContext for each thread (or queue).
The way I’d set it up is to have your main thread (UI) have an NSManagedObjectContext just for fetching the data, and one for inserting on a separate thread, with its parentContext set to the main one. That way when you save on the child context you will see those new objects in the main context and you can do a new fetch (or if you have an NSFetchedResultsController, it will update it for you).
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdConcurrency.html#//apple_ref/doc/uid/TP40003385
The WWDC 2011 videos about core data talk about the parentContext in detail.