0

我有一张带有 3 个带有披露按钮的注释图钉的地图,我想在披露按钮上设置一个 segue,这样当我单击该按钮时,它会将我带到我UITableViewController所谓的“ TableViewController

这是代码:mapview.m

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
    MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapview dequeueReusableAnnotationViewWithIdentifier:@"pinView"];
    if (!pinView) {
        pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinView"];
        pinView.pinColor = MKPinAnnotationColorRed;
        pinView.animatesDrop = YES;
        pinView.canShowCallout = YES;





        UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        pinView.rightCalloutAccessoryView = rightButton;
    } else {
        pinView.annotation = annotation;
    }
    return pinView;
}

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control

{

 // what do i write here?

}
4

1 回答 1

0

将您的 MapController 与 TableViewController 连接起来,并使用带有标识符(例如 ABC)命名的 segue,然后调用

[self performSegueWithIdentifier:@"ABC" sender:self];

在你的 calloutAccessoryControlTapped 方法中

于 2013-09-04T08:29:23.693 回答