i want to get detail disclosure button when i click red pin.
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
static NSString *identifier = @"RoutePinAnnotation";
if ([annotation isKindOfClass:[UICRouteAnnotation class]]) {
pinAnnotation = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pinAnnotation"];
if(!pinAnnotation) {
NSLog(@"entered");
pinAnnotation = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinAnnotation"] autorelease];
pinAnnotation.canShowCallout = YES;
pinAnnotation.pinColor = MKPinAnnotationColorGreen;
rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinAnnotation.rightCalloutAccessoryView = rightButton;
}
}
i used this code for getting detail disclosure button for two location(green pin) and midpoint.