Search code examples
iphonejsonflickr

errors in flickr json iphone


Im following this tutorial for flickr and iphone I have a key, and just using the downloaded code, I get a blank screen in the simulator and the following errors in console

[Session started at 2011-03-02 16:06:53 +1100.]
  2011-03-02 16:06:57.158 JSONFlickr[10188:207] -JSONValue failed. Error trace is: (
 “Error Domain=org.brautaset.JSON.ErrorDomain Code=6 \”Missing hex digit in quad\”    UserInfo=0x4e3ade0 {NSLocalizedDescription=Missing hex digit in quad}”,
  “Error Domain=org.brautaset.JSON.ErrorDomain Code=6 \”Missing hex quad\”  UserInfo=0x4e39a20 {NSUnderlyingError=0x4e39880 \”Missing hex digit in quad\”,   NSLocalizedDescription=Missing hex quad}”,
 “Error Domain=org.brautaset.JSON.ErrorDomain Code=6 \”Broken unicode character\”  UserInfo=0x4e39820 {NSUnderlyingError=0x4e09520 \”Missing hex quad\”,  NSLocalizedDescription=Broken unicode character}”,
 “Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \”Object value expected for key:  title\” UserInfo=0x4e07f20 {NSUnderlyingError=0x4e399a0 \”Broken unicode character\”,  NSLocalizedDescription=Object value expected for key: title}”,
“Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \”Expected value while parsing  array\” UserInfo=0x4e07030 {NSUnderlyingError=0x4e09260 \”Object value expected for key:  title\”, NSLocalizedDescription=Expected value while parsing array}”,
“Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \”Object value expected for key: photo\” UserInfo=0x4e3ba70 {NSUnderlyingError=0x4e397a0 \”Expected value while parsing array\”, NSLocalizedDescription=Object value expected for key: photo}”,
 “Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \”Object value expected for key: photos\” UserInfo=0x4e04dc0 {NSUnderlyingError=0x4e34990 \”Object value expected for key: photo\”, NSLocalizedDescription=Object value expected for key: photos}”
)
2011-03-02 16:06:57.162 JSONFlickr[10188:207] -JSONValue failed. Error trace is: (
“Error Domain=org.brautaset.JSON.ErrorDomain Code=10 \”Garbage after JSON\” UserInfo=0x4e30cb0 {NSLocalizedDescription=Garbage after JSON}”
 )

so as you guess im learning json, and dont understand what this errors mean!, so thanks in advance!


Solution

  • It's clear that the JSON string you are feeding into the parser is garbage. Looking at the error messages, I would say it is probably caused by using an incorrect string encoding. You are probably expecting it to be UTF-8 and getting something else (or vice versa).