How to find which annotation send showDetails?

Posted by Voloda2 on Stack Overflow See other posts from Stack Overflow or by Voloda2
Published on 2010-12-30T18:30:06Z Indexed on 2010/12/30 18:54 UTC
Read the original article Hit count: 182

Filed under:
|

How to find which annotation send showDetails?

MKPinAnnotationView* customPinView = [[[MKPinAnnotationView alloc]
                                             initWithAnnotation:annotation reuseIdentifier:BridgeAnnotationIdentifier] autorelease];
            customPinView.pinColor = MKPinAnnotationColorPurple;
            customPinView.animatesDrop = YES;
            customPinView.canShowCallout = YES;

            // add a detail disclosure button to the callout which will open a new view controller page
            //
            // note: you can assign a specific call out accessory view, or as MKMapViewDelegate you can implement:
            //  - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control;
            //
            UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
            [rightButton addTarget:self
                            action:@selector(showDetails:)
                  forControlEvents:UIControlEventTouchUpInside];
            customPinView.rightCalloutAccessoryView = rightButton;

            return customPinView;

- (void)showDetails:(id)sender
{
  some code
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about mkpinannotationview