I created my own class that I want Core Data to use instead of NSManagedObject
:
@interface MyManagedObject: NSManagedObject {
id delegate;
}
<
Take a look at MOGenerator. It'll help with the regenerating the managed object class files at least: it makes you two files for each one. one that you edit and one that is automatically generated. When you regenerate the latter, the former is untouched.
http://digitalflapjack.com/blog/2010/mar/26/mogeneratorftw/
Don't use inheritance in your data model if you're using the SQL backend. Because of the implementation of the SQL backend, it has horrible performance and space characteristics. (This is Apple's recommendation.)
I may be wrong (I'll double-check), but I think you can do what you want using just the class and header files, without messing with the data model. (This is assuming you don't want to actually store your ivar in the data backend.) Just implement MyManagedObject
like you did, and make your subclasses inherent from MyManagedObject
instead of NSManagedObject
(e.g. Contact : MyManagedObject
). Note that you only have to do this in the header files, and not the actual data model. The compiler should figure out the rest.