views:

137

answers:

1
[[["您好世界","Hello world","N n h o sh ji "]],,"en"]     

this is json object: contentOfResponseDataInJsonValue

I want to get 你好世界. How do it ?

NSString *returnStr=[[[[contentOfResponseDataInJsonValue JSONValue] objectAtIndex:0] objectAtIndex:0] objectAtIndex:0] ;

do this ,error:

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}"

+3  A: 

Looking at the syntax chart at json.org, I would say it is illegal to have two commas in an array with nothing between them. Your JSON is malformed.

[[["您好世界","Hello world","N n h o sh ji "]],,"en"]
                                              ^^ not allowed!

Edit: Just to prove my point, here is a JSON validator.

JeremyP