Hello,
In my application I have a map view with approx. 4000 annotations. It works fine displaying them on the map (with clusters on iOS 11), but once the user leaves the view controller the application cashes. As you can see from the trace below, MapKit tries to insert new annotations after the mapView as been deallocated.
Is this a bug with iOS 11? Or any ideas on how I could fix the problem?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000298
Crashed: com.apple.main-thread
0 MapKit 0x193dc6bac -[MKSpatialCollider insertAnnotationView:] + 244
1 MapKit 0x193d33334 -[MKNewAnnotationContainerView _updateClusterableAnnotationViews:withID:] + 428
2 CoreFoundation 0x1837a0520 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 232
3 MapKit 0x193d33ed4 -[MKNewAnnotationContainerView updateAnnotationViewsForReason:] + 296
4 MapKit 0x193c833d0 -[MKAnnotationContainerView deselectAnnotationView:animated:] + 236
5 MapKit 0x193c9d248 -[MKMapView dealloc] + 464
6 CoreFoundation 0x183859098 cow_cleanup + 112
7 CoreFoundation 0x1837a0370 -[__NSArrayM dealloc] + 68
8 libobjc.A.dylib 0x182b3e138 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 836
9 UIKit 0x18cd06c80 -[UIView dealloc] + 968
10 libobjc.A.dylib 0x182b3e138 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 836
11 CoreFoundation 0x183797d30 _CFAutoreleasePoolPop + 28
12 CoreFoundation 0x183877a94 __CFRunLoopRun + 2020
13 CoreFoundation 0x183797fb8 CFRunLoopRunSpecific + 436
14 GraphicsServices 0x18562ff84 GSEventRunModal + 100
15 UIKit 0x18cd6c2e8 UIApplicationMain + 208
16 APPNAME 0x102087668 main (SBSearchResultsViewController.swift:20)
17 libdyld.dylib 0x1832ba56c start + 4