SO, I have an application with several NSManagedObject
classes, and I'd like to extract some of the logic and put it into a self-contained framework, to be used in other applications.
I have a class like, let's say:
Employee
- firstName (an MOM property)
- lastName (an MOM property)
- (NSString *)fullName (a method)
- (NSUInteger)daysHired (an ObjC property)
- etc...
I'd love to provide this class, and it's MOM definition, in a framework. I figure this is possible by adding a .mom to the framework, defining Employee in there, building the class's .h and .m in the framework. When I want to reuse this class, I just have to include it into a project's build, merge the .mom in the framework with the .mom for the app, and the entities will be available. I guess?
However, I don't see how I can take an entity def/NSManagedObject subclass from the framework and then subclass or extend it in a new app. In order to make relations between my app's NSManagedObjects
and the abstract ones in the framework, I'd have to subclass the framework's entities -- I don't see how you can relate entites in one MOM file to entities in another MOM file, as either superclasses or as the destinations of relations.
Thoughts? Is it possible to provide an MOM in a framework?