【发布时间】:2014-06-15 20:34:18
【问题描述】:
我不确定如何用 swift 语言注释地图。我不知道如何创建 NSObject 类。以下是我试过但无法运行的代码:
import Foundation
import MapKit
class MapPin : MKAnnotation
{
var mycoordinate: CLLocationCoordinate2D
var mytitle: String
var mysubtitle: String
func initMapPin (coordinate: CLLocationCoordinate2D!, title: String!, subtitle: String!)
{
mycoordinate = coordinate
mytitle = title
mysubtitle = subtitle
}
}
【问题讨论】:
-
您必须告诉我们您无法运行它的原因。你遇到了什么样的错误?您打算如何使用它?