Core Data is a framework for managing and persisting objects in iOS and macOS applications. It allows objects to be saved to and retrieved from persistent storage without having to write any of the data access code directly. Core Data includes entities to represent data, managed object contexts to work with entities, and a persistent store coordinator to coordinate saving to persistent stores like SQLite or custom stores. Entities are represented by managed objects that live within managed object contexts.
2. WHAT IS CORE DATA?
•
data persistence framework
•
not a database
3. CORE DATA COMPONENTS
User application
Managed object context
Managed
object
Managed
object
Managed
object
Persistent store coordinator
Persistent store
(SQLite, XML,
in memory,
custom, …)
Managed
object
model
15. TEMPORARY OBJECTS
•
[context save:&error] will save object to main
context (parent context)
•
object is still not saved to persistent store
•
remove object from main context: undo or rollback
•
save object in persistent store: save main context
21. LITERATURE
•
Apple documentation
Core Data programming Guide: https://developer.apple.com/library/mac/documentation/
cocoa/Conceptual/CoreData/cdProgrammingGuide.html
Core Data Core Competencies: https://developer.apple.com/library/ios/documentation/
DataManagement/Devpedia-CoreData/coreDataOverview.html
•
Pro Core Data for iOS - second edition
Michael Privat, Robert Warner