データの送り方
-(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;
}