【发布时间】:2016-02-23 16:00:20
【问题描述】:
from this link我得到相同的 commonName 但它应该不同?!
let jsonData = NSData(contentsOfURL: url!)
let readableJSON = JSON(data: jsonData!, options: NSJSONReadingOptions.MutableContainers, error: nil)
let object = try! NSJSONSerialization.JSONObjectWithData(jsonData!, options: NSJSONReadingOptions.AllowFragments) as! Dictionary<String, AnyObject>
let json = JSON(object)
for (_,object):(String, JSON) in readableJSON {
let commonName = json["toLocationDisambiguation"]["disambiguationOptions"][0]["place"]["commonName"].stringValue
commonNameArray.append(commonName)
}
【问题讨论】:
-
但我希望每一个都能得到不同的价值?!
-
是因为我在 For 循环中设置了我的变量吗?