Given the following JSON:
{
"someKey":"someValue",
"otherKey":"otherValue",
"features":[
"feature1",
"feature2",
"feature3"
]
}
I am mapping this JSON into NSManagedObject
s with RKMapperOperation
and RKEntityMapping
(in this example I would have 2 entity mappings: one for the top level object and another one for my Feature class).
The top level object mapping is trivial: two attribute mappings plus a relationship one(features) for the relation with Feature.
My question is,how to map the features JSON array into an array of Feature objects? The Feature class has just one property name
where I want to store "feature1", "feature2", etc plus a reference to the parent object (the top level one). Something like this:
@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?