【发布时间】:2015-05-04 20:09:33
【问题描述】:
我在创建从我的地图视图到另一个视图控制器的转场时遇到问题。我希望用户单击注释并弹出另一个视图控制器。我在创建注释新闻和下一个视图控制器之间的segue 时遇到了麻烦。我将我的 segue 从地图视图命名为导航视图控制器“annotationPress”。每当我单击地图上的注释时,我都会得到一个全黑的新视图控制器。任何建议将不胜感激。
func mapView(mapView: MKMapView!, annotationView view: MKAnnotationView!, calloutAccessoryControlTapped control: UIControl!)
{
// performSegueWithIdentifier("annotationPress", sender: view)
}
override func performSegueWithIdentifier(identifier: String?, sender: AnyObject?) {
println("segueing...")
if identifier == "annotationPress"
{
}
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "annotationPress"
{
println("hello")
var vc = MapRouteViewController()
}
}
【问题讨论】:
标签: ios iphone swift mapkit mapkitannotation