我正在添加大约1000 MKPolygon秒MKMapView.将叠加层添加到MKMapView其上后,它可以正常工作.但是,如果我快速放大并缩小(偶尔放开缩放以便mapView进程是新的visibleMapRect),我发现应用程序(有时)会崩溃并出现以下异常堆栈跟踪:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSSetM removeObject:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107db6b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010781b141 objc_exception_throw + 48
2 CoreFoundation 0x0000000107d1712a -[__NSSetM removeObject:] + 538
3 VectorKit 0x000000010bae84fa -[VKRasterOverlayTileSource removeOverlay:] + 89
4 VectorKit 0x000000010b79a648 -[VKMapModel removeRasterOverlay:] + 68
5 MapKit 0x0000000106f93bf1 -[MKOverlayContainerView _removeDrawable:forOverlay:level:] + 502
6 MapKit 0x0000000106f92633 -[MKOverlayContainerView addAndRemoveOverlayViews] + 785 …Run Code Online (Sandbox Code Playgroud)