0

我在这里做错了什么。我正在使用 SwiftyJSON。第一行打印正确的值。我在第二行收到一条错误消息:找不到成员字符串。我不应该能够在这里获取字符串值吗?

println(json["weather"][0]["description"])    // prints the correct value
if let description = json["weather"][0]["description"].string {
    self.descriptionLabel.text = description
}
4

1 回答 1

0

尝试这个

descriptionLabel.text = json["weather"][0]["description"].stringValue
于 2015-03-08T02:09:14.063 回答