使用Firebase作为后端,我得到了一系列纬度和经度坐标的字符串,我如何将它们转换为CLLocationCoordinate2D,以便可以将它们用于注释?
以下是每次更新时从Firebase获取信息的代码
var UpdateRef = Firebase(url:"https://ici.firebaseio.com/users")
UpdateRef.observeEventType(.ChildChanged, withBlock: { (snapshot) in
let MomentaryLatitude = snapshot.value["latitude"] as? String
let MomentaryLongitude = snapshot.value["longitude"] as? String
let ID = snapshot.value["ID"] as? String
println("\(MomentaryLatitude)")
var Coordinates = CLLocationCoordinate2D(latitude: MomentaryLatitude as
CLLocationDegrees, longitude: MomentaryLongitude as CLLocationDegrees)
}
最后一行不起作用,我应该用什么代替?