JSON验证错误
问题描述:
[[["您好世界","Hello world","N n h o sh ji "]],,"en"]
这是JSON对象:contentOfResponseDataInJsonValue
JSON验证错误
我想你好世界
。 这是怎么回事?
NSString *returnStr=[[[[contentOfResponseDataInJsonValue JSONValue] objectAtIndex:0] objectAtIndex:0] objectAtIndex:0] ;
做到这一点,错误:
JSONValue failed. Error trace is: ( "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading character\" UserInfo=0x739f0c0 {NSLocalizedDescription=Unrecognised leading character}", "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Expected value while parsing array\" UserInfo=0x739f140 {NSUnderlyingError=0x739f120 \"Unrecognised leading character\", NSLocalizedDescription=Expected value while parsing array}"
答
望着syntax chart at json.org,我会说这是非法的,在两个逗号与他们之间没有一个数组。你的JSON格式不正确。
[[["您好世界","Hello world","N n h o sh ji "]],,"en"]
^^ not allowed!
编辑:只是为了证明我的观点,这里是一个JSON validator。