Ido Hurvits
Ido Hurvits

Reputation: 21

Use of unresolved identifier 'CLLocationCoordinate2D'

I'm keep getting Use of unresolved identifier 'CLLocationCoordinate2D' when trying to build my data. This is a class that holds the data, it appends an array that I will use later in both Map and TableViewController. Any thoughts on why I'm getting this error?

import Foundation import UIKit import CoreData

class StationsData: NSObject {
    //define the varibles
    init () {

    }
    var stations: [StationItem]


    //initiate the array and assig the values to the array
        required init(coder aDecoder: NSCoder) {

            stations = [StationItem]()

            let row0 = StationItem(title: "Station1", address: "25 Israel Eldad St, Jerusalem", coordinate: CLLocationCoordinate2D(latitude: 31.7513239, longitude: 35.224822899999936))
            stations.append(row0)

            let row1 = StationItem(title: "Station2", address: "25 Israel Eldad St, Jerusalem", coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))
            stations.append(row1)

            let row2 = StationItem(title: "Station3", address: "25 Israel Eldad St, Jerusalem", coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))
            stations.append(row2)

            let row3 = StationItem(title: "Station4", address: "25 Israel Eldad St, Jerusalem", coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))
            stations.append(row3)

            let row4 = StationItem(title: "Station5", address: "25 Israel Eldad St, Jerusalem", coordinate: CLLocationCoordinate2D(latitude: 0.0, longitude: 0.0))
            stations.append(row4)

            super.init(coder: aDecoder)!
    }
}

Upvotes: 2

Views: 2324

Answers (1)

user3820674
user3820674

Reputation: 262

You should include Mapkit (import MapKit).

Upvotes: 7

Related Questions