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;
}
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
I had the same problem and setting the MapView delegate in the Storyboard did the trick for me, callout arrows now working:)
I had the same problem, I only put the delegate after annotation and work perfectly!
mapView.delegate = self;
[self.mapView addAnnotation:ann];
Tks, Cauca
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With