Ceci est ma méthode -mapView:viewForAnnotation
qui supprime les épingles lorsque je crée des vues d'annotation. Mais quand je mets mapView.showsUserLocation = YES;
en -viewDidLoad
, je reçois une broche tombée sur Infinite Loop (attendue - dans le simulateur) et pas le point bleu normal.showsUserLocation renvoie la broche au lieu du point bleu dans le simulateur de l'iPhone
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
MKAnnotationView *anno = nil;
//create a pin annotation view
MKPinAnnotationView *pin=[[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pin"]autorelease];
[pin setPinColor:MKPinAnnotationColorRed];
pin.animatesDrop=YES;
pin.canShowCallout = YES;
pin.calloutOffset = CGPointMake(-5, 5);
anno = pin;
return anno;
}
Comment puis-je l'obtenir pour faire tomber les broches et montrer le point bleu?
Merci
C'est la bonne façon de procéder. –
Et vous devez vous demander * pourquoi * est-ce la bonne façon et pourtant nous ne pouvons pas 'setUserLocation' .... – chakrit