我正在使用RestKit和CoreData来管理Mongo数据库。 Rest Service收到的JSON是这样的:
{
"_id": {
"$id": "511bc374a8af9ba27b597633"
},
"name": "javi",
"email": "javi@email123",
"passwordSHA1": 1234,
"nationality": "Brasil",
"gender": 0,
"borndate": 1360686828,
"filephoto_id": 1234567,
"pi_selected": 1,
"profile_interest": [{
"name": "perfil prueba1",
"tourism": ["Cinemas", "Concerts"],
"leisure": ["NightLife", "Bars"],
"foodtype": ["African", "American"]
}, {
"name": "perfil prueba2",
"tourism": ["Theathers", "Concerts"],
"leisure": ["NightLife", "Bars"],
"foodtype": ["African", "American"]
}],
"accesibility": ["Blind", "Deaf"],
"plans": [{
"name": "plan prueba 1",
"location_ids": [10001, 10002, 10003]
}, {
"name": "plan prueba 2",
"locations_ids": [10002, 10003, 10004]
}]
}
我有两个问题:
如何在Coredata中管理此信息(如果您知道任何解释此内容的教程)。到目前为止,当我打电话给Rest Service时,我只能填写“用户”表(不是个人资料,可访问性和计划),但我想用相同的电话填写其他表格。
我可以在“用户”表格中添加属性“id”吗? (如果我收到上面显示的JSON,我如何使用映射提供程序获取它?