I am trying to get the latitude and longitude out of a CLLocationCOordinate2d that is in the first element of the array. I am getting an error with if let saying [CLLocationCoordinate2d]? does not have a member named subscript. Any ideas? Thanks!
override func viewDidLoad() {
super.viewDidLoad()
weather.getLocationDataFromString("California USA", completion: { (location:[CLLocationCoordinate2D]?,error:NSError?) -> (Void) in
if location != nil{
if let coordinate = location[0] as CLLocationCoordinate2D{ // ERROR: [CLLocationCoordinate2d]? does not have a member named subscript
println(coordinate.latitude)
}
}
})
}