objective c - What is the relationship between NSManagedObject subclasses and the xcdatamodeld file? -
- i started creating entities in xcdatamodeld (xcdatamodel) file.
- i subclassed entities using create
nsmanagedobject
subclass… menu entry. - i added custom code these subclasses.
if want make changes (like add/remove attribute, relationship) entity @ moment, make these changes:
- at xcdatamodeld (xcdatamodel) file,
- at custom
nsmanagedobject
subclass, - at both, xcdatamodeld (xcdatamodel) file , custom
nsmanagedobject
subclass?
so, relationship between nsmanagedobject subclasses , xcdatamodeld file?
have keep 2 elements in sync?
xcdatamodeld rules :) or more specifically, resulting managed model. whatever there or not determine store structure.
so ...
make changes in model file first , foremost.
enable echo these changes managed object subclasses.
not mandatory addition, believe mandatory attribute/relationship removal (not tested).
if have custom code, advise add in category on managed object subclass allow regenerate classes interface when change model file.
Comments
Post a Comment