Please help, I get the error: Could not cast value of type '__NSCFString' (0x10f0444a0) to 'NSNumber' (0x10e64c488).
I am trying to loop through all my Latitudes and Longitudes and plot pins on a map
I think it may have someting to do with the fact that they are Strings?!
I am using Firebase so therefore dictionaries
for child in snapDict{
let shotKey = snapshot.children.nextObject() as! FIRDataSnapshot
if let name = child.value as? [String:AnyObject]{
var latitude = name["vLat"] as! Int32
var longitude = name["vLon"] as! Int32
let distancespan:CLLocationDegrees = 5000
let theLocations:CLLocationCoordinate2D = CLLocationCoordinate2DMake(CLLocationDegrees(latitude), CLLocationDegrees(longitude))
self.mapView.setRegion(MKCoordinateRegionMakeWithDistance(theLocations, distancespan, distancespan), animated: true)
let worthingClassPin = mapAnnotation(title: "This is Worthing", subtitle: "Worthing Map", coordinate: theLocations)
self.mapView.addAnnotation(worthingClassPin)
/
/
}
}