Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(IBAction)trash:(id)sender {
- NSLog(@"put to trash");
- MyPointAnnotation *thisAnnotation = (MyPointAnnotation*)[relatedAnnotationView annotation];
- [thisAnnotation setFlaggedForDeletion:YES]; // deletion is managed in delegate didDeselect
- [thisAnnotation.pointMetadata->mapView deselectAnnotation:thisAnnotation animated:NO];
- }
- -(void) mapView:(MKMapView *)theMapView didDeselectAnnotationView:(nonnull MKAnnotationView *)view {
- if (customCalloutView) {
- [customCalloutView removeFromSuperview];
- }
- if([(MyPointAnnotation*)[view annotation] flaggedForDeletion]){
- [view removeFromSuperview];
- [theMapView removeAnnotation:[view annotation]];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement