I have following JSON:
{
"stream": [{
"catalog": {}
}, {
"catalog": {}
}, {
"user": {}
}]
}
with following mapping rules:
[RKResponseDescriptor responseDescriptorWithMapping:catalogMapping
pathPattern:nil keyPath:@"stream.catalog"
statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]];
[RKResponseDescriptor responseDescriptorWithMapping:userMapping
pathPattern:nil keyPath:@"stream.user"
statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]];
Mapping works fine until multiple type of object are in the stream. When stream contain multiple objects, say user and catalog restkit fails this assert:
NSCAssert([representation isKindOfClass:[NSDictionary class]], @"Expected a dictionary representation");
Is there a way map that structure?
streamis an array? - Kevin R