back soft

مطالب مرتبط با «swift json parse int» در back soft | نویسنده: استخدام کار

Swift JSON parsing : unpredictable behaviour

Vote count: 0 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.JSONObjectWithD...

ادامه مطلب

برچسب‌های مرتبط

swift json parsing | swift json parsing library | swift json parsing array | swift json parsing github | swift json parsing tutorial | swift json parsing ios | swift parsing json string | swift json parse int | swift json parser tutorial | swift json parser github