mutualmobile/MMRecord

How to use MMRecordAttributeAlternateNameKey programmatically in my MMRecord subclass.

erhnby opened this issue · 1 comments

How to use MMRecordAttributeAlternateNameKey programmatically in my MMRecord subclass not using in Core Data user interface.

Can you help me ?

Thanks ...

The easiest thing may be to create your own subclass of MMRecordRepresentation and subclass one or both of the following two methods:

- (NSArray *)keyPathsForMappingAttributeDescription:(NSAttributeDescription *)attributeDescription;
- (NSArray *)additionalKeyPathsForMappingPropertyDescription:(NSPropertyDescription *)propertyDescription;

The representation class is intended to be relatively tied to a specific entity. Normally, the base class does the job for the basic use case of MMRecord, but it is intended to be subclassed to support what you're talking about. You'll notice that these methods are what use the MMRecordAttributeAlternateNameKey in the first place. Overriding them gives you a lot of flexibility to change the way MMRecord looks for other property names when parsing attributes and relationships.

Let me know if that works. Thanks!