first question form me.
I'm trying to customize the default blue circle for the user position, but when I redefine the method mapView:viewForAnnotation I, in some way, generate an infinite loop:
The redefined method:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation {
MKPinAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"Pin"];
if (annotation == mapView.userLocation) {
annotationView.image = [UIImage imageNamed:@"user_pin.png"];
annotationView.canShowCallout = YES;
annotationView.animatesDrop = NO;
return annotationView; // was return nil
}
annotationView.image = [UIImage imageNamed:@"other_pin.png"];
annotationView.canShowCallout = YES;
annotationView.animatesDrop = NO;
return annotationView;
}
Some ideas? Possibile causes?
Thanks in advance