如何将JSON对象转换为CLLocationDegrees?如何将JSON对象转换为CLLOCATIONDEGREES?
if let value = response.result.value {
let json = JSON(value)
for (key,subJson):(String, JSON) in json {
let lat = subJson["latitude"] as! CLLocationDegrees
let lng = subJson["longitude"] as! CLLocationDegrees // This will return error
}
}
为JSON数据类型是
{
"latitude": 2323.44555,
"longitude": 2313.344555
}
它只是将不会从JSON工作
正好返回什么错误? – Larme
@Larme'从JSON投射到不相关的对象CLLocationDegrees(又名Double)总是失败',那么应用程序崩溃 – sinusGob
错字'经度'vs'经度'? – vadian