Given the following JSON:
{ "someKey":"someValue", "otherKey":"otherValue", "features":[ "feature1", "feature2", "feature3" ] }
I map this JSON in NSManagedObject to RKMapperOperation and RKEntityMapping (in this example, I would have 2 entity mappings: one for the top-level object and the other for my Feature class).
Displaying top-level objects is trivial: two attribute mappings plus one relationship (function) to relate to Feature.
My question is how to map the functions of a JSON array to an array of Feature objects? The Feature class has only one name property, where I want to store "feature1", "feature2", etc. Plus a link to the parent object (top level). Something like that:
@interface Feature : NSManagedObject //In the implementation file both properties are declared with @dynamic. @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) MyTopLevelObject *myTopLevelObject; @end
Any idea?
source share