I need to add annotations long after mapView has loaded. I try to do the following:
All seems well during the debugging but the annotation dont show on the map.
I tried adding (to the showAnnotation method):
But, still, no results.
In the documenatation I see addAnnotation method called only during loading of the view. Is there a way to add annotation AFTER the view has loaded?
Help is much appreciated...
Code:
//I call a method in mapView Controller
-(void)showAnnotation {
Basic_annotation *annotation = [[[Basic_annotation alloc] initWithCoordinate:myCoords title:@"alert"] autorelease];
[mapView addAnnotation:annotation];
}
//This, in turn, calls the delegae method
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
All seems well during the debugging but the annotation dont show on the map.
I tried adding (to the showAnnotation method):
Code:
[mapView setRegion:mapView.region animated:TRUE];
[mapView regionThatFits:mapView.region];
But, still, no results.
In the documenatation I see addAnnotation method called only during loading of the view. Is there a way to add annotation AFTER the view has loaded?
Help is much appreciated...