我正确地得到了
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;
这条线
[springMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"themes" toKeyPath:@"themes" withMapping:themeMapping]];
应该是
[leafMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"themes" toKeyPath:@"themes" withMapping:themeMapping]];
因为主题嵌套在 leaf 内部(leaf 本身嵌套在 spring 内部)。