0

我想将数据(quelmonument)从 Mapkit 上的精确点传递到另一个视图控制器。使用下面的这段代码,我可以获得很好的价值,但我不知道我可以做些什么来传递数据。

func mapView(mapView: MKMapView!, annotationView: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {

        if control == annotationView.rightCalloutAccessoryView {

            if let pinannotation = annotationView.annotation as? Artwork{

                println("status was = \(pinannotation.quelmonument)")

                var indexmonument = pinannotation.quelmonument


                   performSegueWithIdentifier("hugo", sender: self)

            }

        }

     }

我试图发送值 2,它正在工作,但我想发送“quelmonument”变量而不是 2。你能给我一个提示吗?

func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == "hugo"
        {
            if let destinationVC = segue.destinationViewController as? MonumentViewController{
                destinationVC.numberToDisplay = 2


            }

        }
    }
4

0 回答 0