Quote:
Originally Posted by lapse
It's not created automatically. You need to implement this delegate method which will itself be called automatically by the MKMapView:
Code:
- (MKAnnotationView *) mapView: (MKMapView *) mapView viewForAnnotation: (id<MKAnnotation>) annotation
{
MKPinAnnotationView *pin = (MKPinAnnotationView *) [self.mapView dequeueReusableAnnotationViewWithIdentifier: @"asdf"];
if (pin == nil)
{
pin = [[[MKPinAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @"asdf"] autorelease];
}
else
{
pin.annotation = annotation;
}
pin.pinColor = MKPinAnnotationColorRed;
pin.animatesDrop = YES;
return pin;
}
|
Have you seen evidence that AnnotationViews are actually getting placed on the reuse queue? I have code very similar to the above, but placed in NSLog statements to see when I was reusing and creating new annotations. And it never reuses an annotation.