What is difference between these three classes [NSManagedObject , NSManagedObjectContext , NSManagedObjectModel ]
of core-data and how can we describe in easiest Way?
NSManagedObjectModel provides an API to retrieve a stored fetch request by name, and to perform variable substitution—see fetchRequestTemplate(forName:) and fetchRequestFromTemplate(withName:substitutionVariables:) . You typically define fetch request templates using the Data Model editor in Xcode.
The NSManagedObjectContext class isn't thread safe. Plain and simple. You should never share managed object contexts between threads. This is a hard rule you shouldn't break.
A managed object context is an instance of NSManagedObjectContext . Its primary responsibility is to manage a collection of managed objects. These managed objects represent an internally consistent view of one or more persistent stores.
As I mentioned earlier, the Core Data stack is the heart of Core Data. It's a collection of objects that make Core Data tick. The key objects of the stack are the managed object model, the persistent store coordinator, and one or more managed object contexts.
In database terms:
Of course, Core Data isn't a database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With