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

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -