如何将数据发送到
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:
(id <MKAnnotation>)annotation {
方法。一旦请观察我的代码并给我解决方案。
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation: (id <MKAnnotation>)annotation {
static NSString *defaultPinID = @"com.invasivecode.pin";
MKAnnotationView *pinView =(MKAnnotationView *)[mapview dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
NSLog(@"pinData....%@",pinView);
if (pinView == nil){
pinView = [[MKAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:defaultPinID];
pinView.canShowCallout = YES;
pinView.enabled = YES;
pinView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[pinView setSelected:YES animated:YES];
pinView.image = [UIImage imageNamed:@"location.png"];
}
else{
}
return pinView;
}