简体   繁体   English

在iPhone SDK中,如何在单击MKMapView的注释钉时切换到另一个视图?

[英]How to switch to another view on click of annotation pin in MKMapView in iPhone SDK?

I am making an iPhone app where in there is a requirement of a map. 我正在制作需要地图的iPhone应用程序。

I am using MKMapView for that. 我为此使用MKMapView。 I have placed an annotation at a particular point. 我已在特定位置添加了注释。

I want that when I click that annotation pin then it should take me to another view controller. 我希望当我单击该注释图钉时,它应该将我带到另一个视图控制器。

How can I do this? 我怎样才能做到这一点? I am new in this MKMapView. 我是这个MKMapView的新手。

If you want to go to another viewcontroller by clicking the pin directly. 如果您想通过直接单击图钉去另一个视图控制器。 There is this delegate of MapView 有这个MapView的委托

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
  {
     // Here push your view controller
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM