tags:

views:

13

answers:

1

Hi

how can i use SQL statement in CoreData database ? which part of CoreData hand it ? thanks

and how can i fetch only last elements, not all ?

A: 

If it were possible to write your own SQL statements and have them executed through the Core Data framework, I think it would be described in the documentation for NSPersistentStore or one of its related classes. As far as I can tell, it isn't.

You can always use SQLite directly to load in (and query) the Core Data database without going through the Core Data framework. This can be done either by using SQLite's own APIs, or the sqlite3 program that should already be installed on your Mac. I'm not sure why you'd want to do this on a database that's already managed by Cora Data, though.

David