How to parse JSON response
I wonder how one can parse JSON in iOS. the notification I tried to use:
NSError* error;
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData //1
options:kNilOptions
error:&error];
however, I am giving the following error:
"The operation could not be performed. (Cocoa error 3840.)" (Badly formed object around symbol 310.) UserInfo = 0x135460 {NSDebugDescription = Badly formed object around symbol 310.}
The JSON response I'm trying to parse is:
{"error": 0, "token": "59188a107d705f8c51585d719769e0642ce98b79d86fdace30dbc58efba301cc", "status": "200", "messages": [{"update_time": 2012-03-09 12: 25: 26.0, "seq": "21 "," lng ": 58.4236," msg ":" Bill We-Mark: Test "," lat ": 23.5871}]," error_msg ":" "}
No char 310 here ??? !!!!
+3
source to share
2 answers