views:

37

answers:

2

In XCocde when you create a data model diagram, it will also generate the classes for each entities in the diagram which inherit from NSManagedObject.

The question is are these classes considered my "Model" classes? OR are they just a bridge between my core data and model classes?

PLease if you have a good tutorial let me know, i've been searching all over the place and cannot find a detailed tutorial.

A: 

Yes these classes generated by xcode are the actual model classes. I ended up writing my own model classes and then create the data model diagram based on that. a few notes:

  • every class being used by code data must inherit from NSManagedObject
  • Relationships do not need to be in the code, you can just set them in the model diagram.
  • NSArray and NSMutableArray are not accepted, you should use NSSet instead
  • You should not use int in your model you should use NSNumber instead
  • If you want the core data models to use the classes written by you, then you must set the class names in your model diagram
aryaxt