我正确地获得了titleForHeaderInSection
,其中提取了leaf
。
但themes
没有得到任何内容。
我猜测我的映射到themes
无法正常工作,因为在我设置断点时cellForRowForIndexPath
似乎没有被调用。
但显然我不确定,这就是我寻找指导的原因。谢谢!
API JSON
{
"springs": [{
"name": "baskets",
"leafs": [{
"name": "New Season",
"abbreviation": "nb",
"themes": [{
"name": "Hops",
"abbreviation": "HS",
}
ViewController.h
@property (strong, nonatomic) NSArray *springs;
@property (strong, nonatomic) NSMutableArray *leafs;
@property (strong, nonatomic) NSMutableArray *themes;
答案 0 :(得分:5)
这一行
[springMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"themes" toKeyPath:@"themes" withMapping:themeMapping]];
应该是
[leafMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"themes" toKeyPath:@"themes" withMapping:themeMapping]];
因为主题嵌套在leaf中(它本身嵌套在spring中)。