问题
I would like to remove existing annotation from mapview. Scenerio is to click on existing annotation callout part (disclosureindicator button) and it would lead user to another viewcontroller and shows a button you could remove the selected annotation. Actually, I am working on to create exactly same google map application, that is part I am struggling now. Any help would be appreciated!
回答1:
The MKMapView class has two methods you need to add/remove annotations:
addAnnotation: id <MKAnnotation>
removeAnnotation: id <MKAnnotation>
You'd create a class that implements the protocol MKAnnotation. Here's an example in another SO question: MKAnnotation, simple example
来源:https://stackoverflow.com/questions/12594112/how-to-go-to-second-view-controller-after-click-on-disclosure-indicator-button