以下のメソッドを実装MKMapViewDelegate
し、カスタマイズされたユーザーの場所の注釈が表示されました。しかし、iPhoneを持って歩き回ってもアノテーションが動きませんでした。このデリゲート メソッドを削除すると、デフォルトで青い点のユーザーの場所の注釈が表示されました。
カスタマイズされたユーザーの位置情報を移動する方法を教えてください:
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString* AnnotationIdentifier = @"Annotation";
MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier];
if (!pinView)
{
pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier] autorelease];
pinView.animatesDrop = NO;
pinView.canShowCallout = YES;
}
else
{
pinView.annotation = annotation;
}
pinView.image = [UIImage imageNamed:@"star.png"];
return pinView;
}