I have a map view with pins that when the user selects a pin it goes to a detail screen for that pin. I also have a table view that when the user selects an item it goes to the
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
myAnnotation *annView = view.annotation; // myAnnotation is my custom class for annotations
// now in annView you have the exact annotation whose accessorybutton is clicked now you can do whatever you want with it.
NSLog(@"title = %@",annView.title);
}
Rather then setting the button tag you can use the title or subtitle of the annotation for futher comparision or whatever you want
In your code you are using
[newAnnotation addSubview:pinButton]; // i think this is wrong you should only add it to accessory view