vendredi 28 novembre 2014

solution for cocoa error 3840 NSJSONSerialization


Vote count:

0




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.



asked 35 secs ago







solution for cocoa error 3840 NSJSONSerialization

Aucun commentaire:

Enregistrer un commentaire