Mantle / MTLManagedObjectAdapter

Core Data support for Mantle
https://github.com/Mantle/Mantle
MIT License
140 stars 55 forks source link

Core Data Hierarchy #15

Open andrewjburnett opened 9 years ago

andrewjburnett commented 9 years ago

I have a single APIImage class which inherits from MTLObject. I would like this class to implement the MTLManagedObjectSerializing protocol but I've run into a bit of a snag. My problem is that I have three distinct Image Entities implemented in Core Data all of which could potentially be created from the APIImage class. It seems as though MTLMangedObjectAdapter requires any class which implements the MTLManagedObjectSerializer protocol to define a unique Core Data entity name to which it will be mapped. Any suggestions? Even if I were to implement a hierarchy on the Core Data side (aka a single ImageEntity with three subentities) I don't believe I would be able to map the APIImage objects to their corresponding Core Data Entity class. Is this correct?