我跟着这个tutorial for flickr and iphone 我有一把钥匙,只是使用下载的代码, 我在模拟器中看到一个空白的屏幕,并在控制台中出现以下错误
[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}”
)
所以你猜我正在学习json,并且不明白这个错误意味着什么!,所以提前感谢!
答案 0 :(得分:0)
很明显,你输入解析器的JSON字符串是垃圾。看一下错误消息,我想说这可能是由于使用了错误的字符串编码引起的。您可能期望它是UTF-8并获得其他东西(反之亦然)。