I had a JSON response of this type:
{
"d": { "id": "1", "user": "test"}
}
which I was parsing with Restkit with the following code:
@interface ODataUser : NSObject<ODataObject>
@property (nonatomic, copy) NSString * id;
@property (nonatomic, copy) NSString * user;
-(NSString*)getId;
-(NSString*)getUser;
@end
RKObjectMapping *map = [RKObjectMapping mappingForClass:[ODataUser class]]; [mapping addAttributeMappingsFromDictionary: @{ @"id" : @"id", @"user" : @"user" } ];
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:map method:RKRequestMethodGET pathPattern:nil keyPath:@"d" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
However, now my response has changed to something like this:
{
"d": { "results": [ {"id": "1", "user": "test"} ] }
}
How can I reflect those changes on the response on my code?