我正嘗試在iPhone上使用json-framework來解析json字符串。 當我調用這個方法:JSON驗證
NSDictionary *dictionary = [jsonString JSONValue];
,我發現了錯誤:
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key:
Options\" UserInfo=0x4b5f390 {NSUnderlyingError=0x4b5f320 \"Expected value while
parsing array\", NSLocalizedDescription=Object value expected for key: Options}"
根據這個JSON驗證[1]:http://www.jsonlint.com//我的JSON是無效的。但是那樣嗎?
我的JSON字符串看起來是這樣的:
{
"Options": [
{
"ID": "7",
"A": "1",
"EAt": new Date(2011,
0,
7,
12,
30,
0),
"Type": "Binary",
}
}
*編輯JSON:(仍然帶來了一個錯誤)
{
"Options": [
{
"ID": "7",
"A": "1",
"EAt": new Date(2011,
0,
7,
12,
30,
0),
"Type": "Binary"
}
]
}
刪除逗號後...二進制「 – powtac 2011-01-07 12:19:41