I have an current location annotation (blue dot) showing in mapkit. Annotation shows after taping the blue dot,
how can I have the annotation showing by default?, when I start the view? whit out tapping the pin.
- (void)mapView:(MKMapView *)mv didAddAnnotationViews:(NSArray *)views {
for(MKAnnotationView *annotationView in views) {
if(annotationView.annotation == mv.userLocation) {
self.mapView.userLocation.title= @"Current";
self.mapView.userLocation.subtitle= @"Location";
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta=0.002;
span.longitudeDelta=0.002;
CLLocationCoordinate2D location=mv.userLocation.coordinate;
region.span=span;
region.center=location;
[mv setRegion:region animated:YES];
[mv regionThatFits:region];
}
}
}
In that case, selectAnnotation should work, wouldn’t it? Just performSelector after a small time.
…. same code as before but insert this: