Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS6 Maps, MISSING the Detail Disclosure Button (the blue chevron) on all my maps! How to get it back

My understanding was there was no problems moving to iOS 6 maps. But for some reason, the Detail Disclosure Button is now MISSING in my map App. Is there a way to get this back. Wow, totally unexpected. This has been working for years, so all delegates are fine.

#pragma mark MKMapViewDelegate
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {

MKPinAnnotationView *pin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"REUSEME"] autorelease];
UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];

if ([annotation isKindOfClass:[MKUserLocation class]]) {
    pin.animatesDrop = YES;
    return nil;
} else {
    [pin setPinColor:MKPinAnnotationColorGreen];
}

pin.rightCalloutAccessoryView = button;
pin.animatesDrop = YES;
pin.canShowCallout = YES;

return pin;
}
like image 251
Edward Potter Avatar asked Sep 20 '12 12:09

Edward Potter


3 Answers

Now in iOS 6 you have to set the delegate before adding the annotation to the mapView

seen in here: http://www.openradar.me/12346693

like image 107
caliopigio Avatar answered Nov 01 '22 17:11

caliopigio


I had the same problem and setting the MapView delegate in the Storyboard did the trick for me, callout arrows now working:)

like image 20
bennythemink Avatar answered Nov 01 '22 17:11

bennythemink


I had the same problem, I only put the delegate after annotation and work perfectly!

mapView.delegate = self;
[self.mapView addAnnotation:ann];

Tks, Cauca

like image 32
Cauca Avatar answered Nov 01 '22 17:11

Cauca