【发布时间】:2016-02-29 14:53:58
【问题描述】:
我已经建立了连接,但 我无法从天气数组中获取描述。因为它是一个数组内的字典。
{"weather":
[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}]}
像这样获取温度可以正常工作:
if let main = item["main"] as? NSDictionary {
println("Main existe")
if let temp = main["temp"] {
println("Temp existe")
weatherRequested.append(temp.stringValue)
}
}
【问题讨论】:
标签: json swift parsing httprequest openweathermap