我想知道在iOS中如何解析JSON。注意,我尝试使用:
NSError* error;
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData //1
options:kNilOptions
error:&error];
然而,我遇到了以下错误:
“操作无法完成。(Cocoa错误3840。)”(字符310周围形成不良对象。)UserInfo=0x135460 {NSDebugDescription=字符310周围形成不良对象。}
我尝试解析的JSON响应是:
{"error":0,"token":"59188a107d705f8c51585d719769e0642ce98b79d86fdace30dbc58efba301cc","status":"200","messages":[{"update_time":2012-03-09 12:25:26.0,"seq":"21","lng":58.4236,"msg":"比尔·韦-马克:测试",“lat”:23.5871}],”error_msg“:“”}
这里没有第310个字符??!!