如何解决此构建问题 - 我只是尝试为mapkit创建注释:
错误:" MKAnnotation - 无法分配属性:' title'是一个只获取财产"
import UIKit
import MapKit
class ViewController: UIViewController {
@IBOutlet weak var mapView: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Annotations
var annotation:MKAnnotation
annotation.title = "test" // ** ISSUE IS HERE **
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
注意: - 已下载最新版本的XCode - 这与Swift 2.0有关吗? -