gpt4 book ai didi

swift2 - 使用未解析的标识符 'CLLocationCoordinate2D'

转载 作者:行者123 更新时间:2023-12-02 15:23:19 24 4
gpt4 key购买 nike

在尝试构建我的数据时,我一直在使用未解析的标识符“CLLocationCoordinate2D”。这是一个保存数据的类,它附加了一个我稍后将在 Map 和 TableViewController 中使用的数组。关于我为什么会收到此错误的任何想法?

导入基金会导入 UIKit导入核心数据

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)!
}
}

最佳答案

您应该包括 Mapkit(导入 MapKit)。

关于swift2 - 使用未解析的标识符 'CLLocationCoordinate2D',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33435042/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com