I had called an interface of Baidu to check id Number, however the value of Sex returned with sex = M, without \"\" around the M in JSON, when I us
In my case son {"count":"123"} I got error. Solved:
// Data was created, we leave it to you to display all of those tall tales!
// NSLog(@«data: %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
NSDictionary * json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
if ([json isKindOfClass:[NSDictionary class]]){ //Added instrospection as suggested in comment.
NSArray *dicArray = json[@"count"];
NSLog(@"=:%@", dicArray);
}