CoreData.framework:iOS provides an encapsulation of the original SQLite database API access, which is much simpler and more convenient to manage the data cache and persistent data through this framework than using SQL statements to manipulate the SQLite database.
Mechanism: Using the framework to store and query data requires only the classes provided by the framework, you can manage your data and the relationship between data in the form of objects, and the framework has nicely encapsulated database tables and fields into objects and properties. A one-to-many, many-to-many relationship between tables is encapsulated as a containment relationship between objects.
By means of relationship:
One-to-one: set to Properties Select Optional, Plural option To-many relationship selected;
When a many-to-one inverse relationship occurs: The properties item is selected Optional, the Count entry selects Minimun and Maximun and sets its value to 1 respectively;
Core Data Features:
1) The power of Core data is that this relationship can be updated with an object, and its associated objects are updated as you update a table, and the other tables associated with it are updated as well.
2) Another feature of Core data is the provision of simpler performance management mechanisms, such as the use of the Nsfetchedresultscontroller class, Instead of using the limit of SQL, you can limit the total number of query records by using the Setfetchbatchsize () of the Nsfetchrequest class. The magic of the Nsfetchedresultscontroller class is that when more records are needed, the class automatically updates its cache.
3) for a multi-table query on the relative, CoreData no SQL intuitive, but the CoreData function can still complete the relevant operation.
But for similar outer connection, left connection and so on operation, in CoreData appears powerless.
Comparison between CoreData and SQLite