I have defined quite a simple mapping, having some plain properties, however now I run into the problem that my data structure on the Server is a tree, so I get a list of "CustomObject" which contains some properties and a list of "CustomObject" which ...
So in code it looks like this (simplified)
+ (RKObjectMapping*)getCustomObjectMapping
{
RKObjectMapping* customObjectMapping = [RKObjectMapping mappingForClass:[CustomObject class]];
[customObjectMapping mapKeyPath:@"title" toAttribute:@"title"];
[..]
// Define the relationship mapping
//[customObjectMapping mapKeyPath:@"nextLevel" toRelationship:@"nexLevel" withMapping:[self getCustomObjectMapping]];
return customObjectMapping;
}
Which results obviously in an endless recursion.
Is there a smart way to do this mapping?