Search code examples
iphoneiosmkmapviewios6mkannotationview

iOS6 MKMapView custom annotations doesn't render


My application worked correctly in iOS5, after update to iOS6 I have trouble rendering my own annotations on MKMapView. I found, that (MKAnnotationView *)mapView:(MKMapView *)_mapView viewForAnnotation:(id<MKAnnotation>)annotation function isn't called. So I see only default red pins on map. Here is my initialization code:

[self setMapView:[[MKMapView alloc] initWithFrame:CGRectMake(FRAME_X, FRAME_Y, FRAME_FULL_WIDTH, FRAME_HEIGTH)]];
[self.mapView addAnnotations:self.annotations];
[self.mapView setDelegate:self];
[self.view addSubview:self.mapView];

Solution

  • phix23 solution was correct. I needed to set delegate before annotations