A followup to this quesiton:
When returning from the flipside view, I'm calling
NSArray *annotations = [NSArray arrayWithArray:[mapView annotations]];
[mapView removeAnnotations:annotations];
To remove all the pins from the map (let me know if this isn't the best way to do this).
Then:
for(Hole *hole in fetchedObjects)
{
double latitude = [hole.Latitude doubleValue];
cord.latitude = latitude;
double longitude = [hole.Longitude doubleValue];
cord.longitude = longitude;
WellPlaceMark *placemark = [[WellPlaceMark alloc] initWithCoordinate:cord withWellType:[NSString stringWithString: hole.WellType]];
[mapView addAnnotation:placemark];
}
Plus:
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
if([annotation isKindOfClass:[WellPlaceMark class]])
{
...
}
annView.animatesDrop=FALSE;
return annView;
}
All of this code seems to be called in the debugger, but when it's finished, I'm presented with a blank map. I've tried zooming out and the pins are nowhere. The map loads up fine on the first try, but once I call removeAnnotations
, they never return.