2011-02-17 103 views
0

當JSONValue無法讀取json iphone時,應用程序崩潰了嗎?當JSONValue無法讀取json時應用程序崩潰iphone

這裏什麼即時得到

Response [{"profile_pic":"1.jpg","user_name":"Jack"}] 
2011-02-17 13:37:38.209 App[3964:207] -JSONValue failed. Error trace is: (
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object key string expected\" UserInfo=0x6057070 {NSLocalizedDescription=Object key string expected}", 
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Expected value while parsing array\" UserInfo=0x6057120 {NSUnderlyingError=0x60570d0 \"Object key string expected\", NSLocalizedDescription=Expected value while parsing array}" 
) 
+0

您的JSON字符串是有效的。你使用最新的SBJSON版本嗎? – 2011-02-17 08:53:36

回答

0

嘿,我試着與你的輸入,並通過

NSLog(@"%@", [@"[{\"profile_pic\":\"1.jpg\",\"user_name\":\"Jack\"}]" JSONValue]); 

了[會話開始於2011-02-17十四時38分48秒0500]

2011-02-17 14:38:49.970 iJSON [3349:207]

(
     { 
     "profile_pic" = "1.jpg"; 
     "user_name" = Jack; 
    } 
)