我正在尝试在 XCode 上使用 SwiftyJSON 从 JSON 打印属性(显然使用 Swift 语言)
我的第一行打印得很好,但第二行什么也没打印,我在在线解析器中检查了第一个 println() 的输出,并且字符串是一致的:
var jdata = JSON(self.serverResponse)
println("jdata RAW: "+jdata.stringValue)
println("jdata.responseData: "+jdata["responseData"].stringValue)
这是打印这两个东西的结果,你可以看到第二个是空白的:
jdata RAW:
{
"responseData": {
"emotion":"",
"lastinput":"What is your favourite color",
"answer":"My favourite color is orange. What is yours?",
"link": {
"href":"",
"target":""
},
"extraData": {
"action":{"name":"displayClickableList","values":[{"label":"green","key":"1"},{"label":"yellow","key":"2"},{"label":"red","key":"3"}]},"type":"list"
},
"responseSession": {
"id":"1ebfcd96c3c1f206dfb4087bc553",
"transaction":"2"
},
"responseDetails": null,
"responseStatus": 200,
"applicationUrl": "http://moto-dev.cloud.com:88/moto-va-1/;jsessionid=1ebfc206dfb4087bc553"
}
}
jdata.responseData:
我是 Swift 新手,这里出了什么问题?