I've read a lot of topics about Swift Json parsing but as the result I found unpredictable behaviour. E.g., for this code:
if let city = cities[ndx] as? [String: AnyObject],
let population: UInt64 = (city["population"] as? NSNumber)!.unsignedLongLongValue {
if (population > 0) {
if let name = city["name"] as? String,
let lat: Double = Double((city["lat"] as? String)!),
let lon: Double = Double((city["lng"] as? String)!),
}
}
to retrieve integer value I have to use AnyObject > NSNumber > UInt64 conversion but for double value: AnyObject > String > Double.
Is it usual behaviour for all devices? Are there any other stange conversions while using NSJSONSerialization.JSONObjectWithData?
