I am getting a json service to which I want to do comparison checks on the values of certain keys. For example I have a key ‘status’ in json array, but I am unable to do a comparison check on its value.
The response is like:
{"status":400,"response":"No cast found"}
I want to do something like:
if([jsonDict objectForKey:@"status"] == @"400"){
..
}
but the check wont work, whats the right way to do it?
It can be two things:
If [jsonDict objectForKey:@”status”] is giving you a NSString, then the correct way to compare is:
If [jsonDict objectForKey:@”status”] is giving you a NSNumber, or NSDecimalNumber: