通过CS193P,我被这个错误困住了。我为什么要犯这个错误?
是什么遗漏了密码?
MKGPX.swift
import MapKit
extension GPX.Waypoint: MKAnnotation
{
var cooridnate:CLLocationCoordinate2D {
return CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
}
var title:String! { return name }
var subtitle:String! { return info }
}点类
class Waypoint: Entry, Printable
{
var latitude: Double
var longitude: Double
init(latitude: Double, longitude: Double) {
self.latitude = latitude
self.longitude = longitude
super.init()
}
var info: String? {
set { attributes["desc"] = newValue }
get { return attributes["desc"] }
}
lazy var date: NSDate? = self.attributes["time"]?.asGpxDate
override var description: String {
return " ".join(["lat=\(latitude)", "lon=\(longitude)", super.description])
}
}MKAnnotation
protocol MKAnnotation : NSObjectProtocol {
// Center latitude and longitude of the annotation view.
// The implementation of this property must be KVO compliant.
var coordinate: CLLocationCoordinate2D { get }
// Title and subtitle for use by selection UI.
optional var title: String! { get }
optional var subtitle: String! { get }
}发布于 2015-06-23 12:19:28
只是一个想法,但你是使用SWIFT1.1还是1.2。如果您正在使用1.2Paul发布了新版本的Trax MapKit和Trax用于SWIFT1.2。-> https://web.stanford.edu/class/cs193p/cgi-bin/drupal/
或者您可能在MKGPX.swift中拼错了"var坐标“。
https://stackoverflow.com/questions/30872099
复制相似问题