Why does this JSON fail only in iPhone?

Posted by 4thSpace on Stack Overflow See other posts from Stack Overflow or by 4thSpace
Published on 2010-03-15T01:56:11Z Indexed on 2010/03/15 1:59 UTC
Read the original article Hit count: 552

I'm using the JSON framework from http://code.google.com/p/json-framework. The JSON below fails with this error:

-JSONValue failed. Error trace is: (
Error Domain=org.brautaset.JSON.ErrorDomain Code=5 UserInfo=0x124a20 "Unescaped control character '0xd'",
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x11bc20 "Object value expected for key: Phone",
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x1ac6e0 "Expected value while parsing array"

)

JSON being parsed:

[{"id" :"2422","name" :"BusinessA","address" :"7100 U.S. 50","lat" :"38.342945","lng" :"-90.390701","CityId" :"11","StateId" :"38","CategoryId" :"1","Phone" :"(200) 200-2000","zip" :"00010"}]

I think 0xd represents a carriage. When I put the above JSON in TextWrangler, I don't see any carriage returns. I got the JSON by doing "po myjson" in the debugger. It passes this validator: http://json.parser.online.fr/. Can anyone see what the problem may be?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk