Ia m getting an cocoa error 3840 when I am trying to serialize the JSON response and I am getting the following error message in the console "JSON text did not start with array or object and option to allow fragments not set." But i happened to check the response in chrome client and I get the correct response. And when I copy pasted the response in JSONValidator, I got it as a valid JSON. But in my iOS app I am somehow not able to get the response.
Is there a way to fix it from iOS code? I tried all possible solutions from internet.
NSError *error = nil;
NSMutableArray *jsons = [NSJSONSerialization JSONObjectWithData:theResponseData options:NSJSONReadingAllowFragments error:&error];
NSLog(@"connectionDidFinishLoading %@", jsons);
I tried MutableContainers, MutableLeaves and kNil in options of serialization. Still I am not able to fetch the data.
Try this - hope it will work
If it doesn't work then
This is the only sample content your Web response should contain.