次の JSON 構造があります。
{"projekt":{
"id":18,
"projectname":"test",
"dokumente":{
"id":1190,
"name":"rootfolder",
"information":{
"folder":[
{
"id":1191,
"name":"folder 1",
"information":""
},
{
"id":1198,
"name":"folder 2",
"information":{
"folder":[
{
"id":1199,
"name":"folder 2 1",
"information":""
},
{
"id":1199,
"name":"folder 2 2",
"information":""
}
]
}
}
]
}
}
}}
基本的に、再帰的なフォルダー構造です。プロジェクト、情報、およびフォルダー用の RKObjectMappings があります。information=""
に到達するまで、解析はうまくいきます。RestKit が呼び出しを試みるようになりました
value = [self.sourceObject valueForKeyPath:relationshipMapping.sourceKeyPath];
RKObjectMappingOperation の 442 行目。 sourceKeyPath がfolder
このinformation
要素で使用できないため、これは失敗します。これによりNSUnknownKeyException
、解析が停止します。
私が望むのは、RestKit が情報要素を無視して nil に設定することです。どうすればこれを達成できますか?