How can I make all Core Data objects inherit from my class rather than NSManagedObject?

后端 未结 2 1011
暗喜
暗喜 2021-01-15 17:02

I created my own class that I want Core Data to use instead of NSManagedObject:

@interface MyManagedObject: NSManagedObject {
  id delegate;
}
<         


        
2条回答
  •  耶瑟儿~
    2021-01-15 17:38

    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/

提交回复
热议问题