有人可以帮我找出问题所在吗?
两年前,我发现其他人也遇到了同样的问题:( 看这里: Exception when zooming with overlays on MKMapView: NSInvalidArgumentException NSSetM removeObject: object cannot be nil
我不会在主线程中添加或删除某些内容。
该应用有时会运行7小时而不会出现问题。 通过大量缩放或平移,我可以强制应用程序失败。
示例堆栈:
*由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'* -[__ NSSetM removeObject:]:对象不能为空'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a8d66fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010960dac5 objc_exception_throw + 48
2 CoreFoundation 0x000000010a824ddc _CFThrowFormattedException + 194
3 CoreFoundation 0x000000010a84918c -[__NSSetM removeObject:] + 444
4 VectorKit 0x0000000122808104 -[VKRasterOverlayTileSource removeOverlay:] + 89
5 VectorKit 0x000000012244cb57 -[VKMapModel removeRasterOverlay:] + 68
6 MapKit 0x000000010b92604c -[MKOverlayContainerView _removeDrawable:forOverlay:level:] + 517
7 MapKit 0x000000010b9249f2 -[MKOverlayContainerView addAndRemoveOverlayViews] + 758
8 MapKit 0x000000010b8c821d -[MKMapView _didChangeRegionMidstream:] + 181
9 MapKit 0x000000010b8cd4a2 -[MKMapView mapLayer:didChangeRegionAnimated:] + 67
10 VectorKit 0x0000000122405e54 -[VKMapView map:didChangeRegionAnimated:] + 122
11 VectorKit 0x00000001224804bf -[VKMapCameraController rotateToPitch:withPoint:preserveAltitude:animated:exaggerate:] + 1480
12 VectorKit 0x0000000122481b44 -[VKMapCameraController snapMapIfNecessary:] + 300
13 MapKit 0x000000010b92604c -[MKOverlayContainerView _removeDrawable:forOverlay:level:] + 517
14 MapKit 0x000000010b9249f2 -[MKOverlayContainerView addAndRemoveOverlayViews] + 758
15 MapKit 0x000000010b8c821d -[MKMapView _didChangeRegionMidstream:] + 181
16 MapKit 0x000000010b8cd4a2 -[MKMapView mapLayer:didChangeRegionAnimated:] + 67
17 VectorKit 0x0000000122405e54 -[VKMapView map:didChangeRegionAnimated:] + 122
18 VectorKit 0x000000012248419b -[VKMapCameraController _animateToPosition:pitch:yaw:duration:timingCurve:completion:] + 1797
19 VectorKit 0x000000012248468b -[VKMapCameraController setCenterCoordinate:altitude:yaw:pitch:duration:animationStyle:timingCurve:completion:] + 331
20 VectorKit 0x0000000122401391 -[VKMapView setCenterCoordinate:altitude:yaw:pitch:duration:timingCurve:completion:] + 411
21 MapKit 0x000000010b904bc4 -[MKMapView(MKCamera) _updateFromCamera:duration:timing:completionHandler:] + 507
22 MapKit 0x000000010b904836 -[MKMapView(MKCamera) _setCamera:duration:timing:completionHandler:] + 222
23 MapKit 0x000000010b90468f -[MKMapView(MKCamera) _setCamera:animated:] + 277
24 MapKit 0x000000010b8daa0c -[MKMapView setCamera:animated:] + 231
25 VW-R-CLUB Member APP 0x00000001034575cf $s20VW_R_CLUB_Member_APP17MapViewControllerC24headingDisplayLinkUpdate33_A3F09DE885E5AFD820CE3A36D7605AB9LL4linkySo09CADisplayJ0C_tF + 2095
26 VW-R-CLUB Member APP 0x0000000103457b7c $s20VW_R_CLUB_Member_APP17MapViewControllerC24headingDisplayLinkUpdate33_A3F09DE885E5AFD820CE3A36D7605AB9LL4linkySo09CADisplayJ0C_tFTo + 60
27 QuartzCore 0x0000000106b50d97 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 663
28 QuartzCore 0x0000000106c1f4a2 _ZL22display_timer_callbackP12__CFMachPortPvlS1_ + 297
29 CoreFoundation 0x000000010a812096 __CFMachPortPerform + 150
30 CoreFoundation 0x000000010a83e419 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
31 CoreFoundation 0x000000010a83da7b __CFRunLoopDoSource1 + 459
32 CoreFoundation 0x000000010a83800a __CFRunLoopRun + 2490
33 CoreFoundation 0x000000010a837302 CFRunLoopRunSpecific + 626
34 GraphicsServices 0x00000001107e72fe GSEventRunModal + 65
35 UIKitCore 0x00000001145fbba2 UIApplicationMain + 140
36 VW-R-CLUB Member APP 0x000000010379ebeb main + 75
37 libdyld.dylib 0x000000010d151541 start + 1
) libc ++ abi.dylib:以类型为NSException的未捕获异常终止