0
var view: MKPinAnnotationView
view.rightCalloutAccessoryView = UIButton.buttonWithType(.DetailDisclosure) as! UIView
问题我是新来的swift。在我参加在线教程(https://www.raywenderlich.com/90971/introduction-mapkit-swift-tutorial)时,上面代码的第二行给出了以下问题;Swift - 使用buttonWithType和
buttonWithType
未被识别。因此我使用的是buttonType: UIButtonType
,但它仍然给我一个错误在同一行代码
as!
产生一个错误。
链接教程中的代码是用Swift 2编写的。如果您使用的是Swift 3,则需要将代码转换为新的语法。 – vadian