我收到这样的 JSON 对象:
{"data":null,
"error":1,
"error_code":"InvalidSID",
"sid":"",
"num_rows_total":0,
"last_insert_id":0,
"error_info":"Comment...",
"error_data":[]}
和 JSONKit 使用此代码:
NSString *responseString = [request responseString];
NSDictionary *requestDictionary = [responseString objectFromJSONString];
if([[requestDictionary objectForKey:@"error"] intValue]) {
if([@"InvalidSID" isEqualToString:[requestDictionary objectForKey:@"error_code"]]) {
[self.navigationController popViewControllerAnimated:YES];
}
}
产生这样的输出:
{
data = "<null>";
error = 1;
"error_code" = InvalidSID;
"error_data" = ();
"error_info" = "Comment...";
"last_insert_id" = 0;
"num_rows_total" = 0;
sid = "";
}
if
问题是,由于 . 周围缺少引号,因此永远不会调用此语句InvalidSID
。JSONKit 是否存在使这些引号消失的已知问题?