3
我有以下JSON結構:導線向上在JSON使用映射時RestKit 0.20
{
"category": "MyCategory"
"objects": [
{ "id": 1, "name": "A" },
{ "id": 2, "name": "B" },
{ "id": 3, "name": "C" }
]
}
我映射每個對象到一個單獨的核心數據實體是這樣的:
RKEntityMapping *mapping = [RKEntityMapping mappingForEntityForName:@"Object" inManagedObjectStore:manager.managedObjectStore];
mapping.identificationAttributes = @[ @"id" ];
[mapping addAttributeMappingsFromDictionary:@{ @"name": @"name" }];
如何是否配置映射以在每個對象上存儲共享類別?
我想的事情是要能夠向上遍歷的JSON這樣的:
[mapping addAttributeMappingsFromDictionary:@{ @"name": @"name", @"PARENT.category": @"category" }];
http://en.wikipedia.org/wiki/Depth-first_search – 2013-05-26 21:10:47
我不明白的鏈接是如何有用嗎? – thejaz