Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我运行以下代码时,出现错误“无法调用非函数类型 'MKMapItem?' 的值?”
request.source(MKMapItem.mapItemForCurrentLocation())
它在 swift 1.2 中运行良好,发生了什么变化?
在 Swift 2 (Xcode Beta 5) 中,source现在是 的属性MKDirectionsRequest:
source
MKDirectionsRequest
因此,而不是:
就是现在:
request.source = MKMapItem.mapItemForCurrentLocation()