I have a Json Response like this.
{
"ss": 1,
"tc": 75,
"pn": "1",
"users": [
{
"id": "123456",
"ne": "John Smith",
"el": "example@example.com"
},
{
"id": "3213243",
"ne": "iPhone Guy",
"el": "sdads@dsss.com"
}
]
}
Code:
[manager loadObjectsAtResourcePath:@"path/to/resources" usingBlock:^(RKObjectLoader* loader) {
loader.method = RKRequestMethodPOST;
loader.params = inputDict;
loader.onDidLoadResponse = ^(RKResponse *response)
{
NSLog(@"Response is %@",response);// here it contains ss value
};
loader.onDidLoadObjectsDictionary = ^(NSDictionary *dictionary)
{
// NSLog(@"Dictionary is %@",dictionary);
};
loader.onDidFailWithError = ^(NSError *error)
{
NSLog(@"Restkit Error is %@",error);
};
loader.onDidLoadObjects = ^(NSArray * objects)
{
NSLog(@"Object Count is %d",[objects count]);
};
}];
From that above response, i would like to check if the success(ss) is 0 or 1. if it is 0, i don’t need to map users else i want to map users. how can i do that. Do i need to map ss,tc and pn or is it possible to check ss value w/o mapping.
Any help is appreciated.
I found the solution
the dictionary value contains value and key. from that i can get the value of ss.