It seems that an NSEntityDescription
object describes data and an NSManagedObject
object contains the corresponding data. If you have a normal NSObject
subclass, the description of the data and the actual data are in the same place, aren't they. Well at least the description is in the class and the data is in the object. You can think of an object as having a description of the kind of variables it contains.
Why then does Core Data separate the class which describes the data and the class which contains the data? Is it to do with faulting?
If you have a normal NSObject subclass, the description of the data and the actual data are in the same place, aren't they.
No. The class is the description of the object and the instance is the object (including its data.
Why then does Core Data separate the class which describes the data and the class which contains the data? Is it to do with faulting?
No it is because the description of the model is intrinsically different to the instantiation of data that complies with the model. This is a standard thing in computing e.g. for a SQL database, the description of the data (the DDL) is not the data (an actual database). With XML the description (schema or DTD) is not the actual XML data.
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