How to call pin annotation on button click in iPhone

旧巷老猫 提交于 2019-12-02 06:15:49

The method that you are trying to call is a mapView delegate method and should only be called by your MapView. This method is only for providing the annotation's view "on demand" when the mapView needs it. I.e. When the annotation is in or about to move into the mapView's visible region.

You need to add an annotation object to your mapView. This object must conform to the MKAnnotation Protocol. http://developer.apple.com/library/ios/documentation/MapKit/Reference/MKAnnotation_Protocol/

You will add the object to the mapView by calling [yourMapView addAnnotation: yourAnnotationObject] in the IBAction method that is called when your button is pushed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!