你已经离开了
mapView:annotationView:calloutAccessoryControlTapped:
方法
创建一个特性以保留对轻敲详图索引中图像的引用:
@property (nonatomic, strong) UIImage *selectedCalloutImage;
并更新委托方法:
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
companytitle = view.annotation.title;
description = view.annotation.subtitle;
thumbprofileimage = view.image;
//thumbprofileimage = [(UIImageView *)view.leftCalloutAccessoryView setImage:pin.image];
//UIImageView *leftIconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
//leftIconView = [view.leftCalloutAccessoryView [[UIImageView alloc]];
//view.leftCalloutAccessoryView;
// Keep a reference to the callout's image
self.selectedCalloutImage = [(UIImageView *)view.leftCalloutAccessoryView image];
[self performSegueWithIdentifier:@"showPlattegrondDetails" sender:self];
}
然后将图像传递给中的后续控制器
prepareForSegue:sender:
方法:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"showPlattegrondDetails"])
{
DetailViewController *controller = segue.destinationViewController;
controller.image = self.selectedCalloutImage;
}
}
然后,您可以随心所欲地显示/使用它。