いくつかのプレーンなプロパティを持つ非常に単純なマッピングを定義しましたが、サーバー上のデータ構造がツリーであるという問題が発生したため、いくつかのプロパティを含む「CustomObject」のリストと「CustomObject」のリストを取得します" どれの ...
したがって、コードでは次のようになります(簡略化)
+ (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;
}
これは明らかに無限の再帰をもたらします。
このマッピングを行うための賢い方法はありますか?