How to generate an Entity Model from an existing ManagedObject subclass?
I have already written NSManagedObject
subclasses and now want to generate entities out of these, is th开发者_StackOverflow中文版is possible?
I know how to generate NSManagedObject
subclasses from the Entity, but I'm interested in the other way around, anyone?
P.S. I'm using XCode 4.
There are no Xcode tools to "pull in" a model from NSManagedObject subclasses. Your best bet is to Google around for some reverse-engineering tools but I doubt any exist that would reliably do what you want.
Custom NSManagedObject classes are meant to extend the functionality of entities described by the Managed Object Model. It's the Managed Object Model that's supposed to be the definitive authority. Your classes may completely describe the entity as it would exist in the MOM but in practice most do not (they have only the "extra custom stuff"), so there's no way to guarantee a complete model would be generated from a collection of NSManagedObject subclasses.
精彩评论