MapKit: callouts are not always removed when an annotation view is re-used

Originator:robotspacer
Number:rdar://19507725 Date Originated:16-Jan-2015 09:30 PM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8.2 (12D5461b), and various other iOS 8 versions
Classification:UI/Usability Reproducible:Sometimes
 
Summary:
My app Deliveries will drop a pin on the map, zoom into that area, then show the callout for that pin. If a different item is selected, existing pins are removed, and the same sequence happens again in a different location. If the timing is just right, the re-used annotation view will still have a callout visible from the previous item. I *think* the important thing in triggering the bug is to remove the annotation while the callout is still animating in.

Steps to Reproduce:
1. Run the attached project. (I've seen this bug on iPhone, but for some reason found it easier to reproduce on iPad.)
2. Click the "Drop Pin" button.

Expected Results:
Only one callout should be visible. Clicking elsewhere on the map should dismiss it.

Actual Results:
Sometimes there are two, and only one can be dismissed. Sometimes you may see one callout to the left of the pin and one on the right. Sometimes they are directly on top of each other.

Version:
iOS 8.2 (12D5461b), and various other iOS 8 versions

Notes:
The attachment includes a screenshot showing one result of this bug, along with the sample project.

This bug is also present on OS X, see rdar://19493144

I've had a much tougher time reproducing the bug on iOS compared to OS X. In the sample app it seems slightly more likely to happen the first time "Drop Pin" is tapped, but I'm not positive. I've tried adjusting the delay before placeAndSelectPin is called but can't find a timing that triggers it consistently.

The worst part about this bug is that it's persistent—once the extra callout is there, it will remain there every time that annotation view is removed. Unless I add some hacky code to work around it, it stays there until the map view (or the entire app) is reloaded.

Configuration:
iPad Air, 128GB, Wi-Fi (I've also seen this on iPhone 6, iPad Air 2)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!