Manage object graphs and object lifecycle, including persistence.
- iOS 3.0+
- macOS 10.4+
- tvOS 9.0+
- watchOS 2.0+
Use Core Data to manage the model layer objects in your application. It provides generalized and automated solutions to common tasks associated with object lifecycle and object graph management, including persistence.
Core Data drastically decreases the amount of code you write to support the model layer. This is primarily due to the following built-in features that you do not have to implement, test, or optimize:
Change tracking and built-in management of undo and redo beyond basic text editing.
Maintenance of change propagation, including maintaining the consistency of relationships among objects.
Lazy loading of objects, partially materialized futures (faulting), and copy-on-write data sharing to reduce overhead.
Automatic validation of property values. Managed objects extend the standard key-value coding validation methods to ensure that individual values lie within acceptable ranges, so that combinations of values make sense.
Schema migration tools that simplify schema changes and allow you to perform efficient in-place schema migration.
Optional integration with the application’s controller layer to support user interface synchronization.
Grouping, filtering, and organizing of data in memory and in the user interface.
Automatic support for storing objects in external data repositories.
Sophisticated query compilation. Instead of writing SQL, you can create complex queries by associating an
NSPredicateobject with a fetch request.
Version tracking and optimistic locking to support automatic multiwriter conflict resolution.