Giuseppe Sala
Giuseppe Sala

Reputation: 373

Swift : Crash when zoom out on map with cluster

I have a view with a map and a lot of pin. I have clustered the pin and when i zoom in to reveal the single annotation all works. When I instead try to zoom out the app crashes.

I have this error message but i'm not so pro to understand the problem.

i searched on google and inside StackOverflow but without success.

I have already seen: iOS : App crashes when zooming out a map

Can anyone help me? Thank you in advance for all the answers you can give me.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSDictionaryM setObject:forKey:]: key cannot be nil' *** First throw call stack: ( 0 CoreFoundation 0x000000010f98b1ab __exceptionPreprocess + 171

1 libobjc.A.dylib  0x000000010a909f41 objc_exception_throw + 48

2 CoreFoundatio    0x000000010f9caf9c _CFThrowFormattedException + 194

3 CoreFoundation   0x000000010f89f918 -[__NSDictionaryM setObject:forKey:] + 952

4 MapKit           0x000000010be8007a -[MKNewAnnotationContainerView _existingClusterViewsForClusterID:] + 174

5 MapKit           0x000000010be7f79c -[MKNewAnnotationContainerView addAnnotationView:allowAnimation:] + 173

6 MapKit           0x000000010bdf99f0 -[MKMapView addAnnotationRepresentation:allowAnimation:] + 727

7 MapKit           0x000000010beb6420 -[MKAnnotationManager _addRepresentationForAnnotation:] + 838

8 MapKit           0x000000010beb45b2 -[MKAnnotationManager addRepresentationsForAnnotations:] + 494

9 MapKit           0x000000010bdf1661 -[MKMapView annotationContainer:requestAddingClusterForAnnotationViews:] + 675

10 MapKit          0x000000010be80260 -[MKNewAnnotationContainerView _updateClusterableAnnotationViews:withID:] + 461

11 CoreFoundation  0x000000010f90fea2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226

12 MapKit          0x000000010be8125e -[MKNewAnnotationContainerView updateAnnotationViewsForReason:] + 299

13 MapKit          0x000000010bf7b17a -[MKAnnotationContainerView finishAddingAnnotationViews] + 29

14  MapKit         0x000000010bdfa315 -[MKMapView annotationManager:didAddAnnotationRepresentations:] + 53

15  MapKit         0x000000010beb5737 -[MKAnnotationManager updateVisibleAnnotations] + 1876

16  MapKit         0x000000010bde81b2 -[MKMapView _didChangeRegionMidstream:] + 223

17  MapKit         0x000000010bded5a1 -[MKMapView mapLayer:didChangeRegionAnimated:] + 79

18  VectorKit      0x0000000113e09125 -[VKMapView map:didChangeRegionAnimated:] + 122

19  VectorKit      0x0000000113e84e3b __58-[VKMapCameraController zoom:withPoint:completionHandler:]_block_invoke.145 + 62

20  VectorKit      0x0000000113e3b97d -[VKAnimation stopAnimation:] + 109

21  VectorKit      0x0000000113e3bd65 -[VKTimedAnimation stopAnimation:] + 47

22  VectorKit      0x0000000113e3be47 -[VKTimedAnimation onTimerFired:] + 47

23  VectorKit      0x0000000113db5e46 _ZN2md16AnimationManager12onTimerFiredEd + 298

24  VectorKit      0x000000011405bff1 _ZN2md9MapEngine11layoutSceneEdb + 85

25  VectorKit      0x000000011405bf85 -[_MapEngineRenderQueueSource renderQueueForTimestamp:] + 27

26  VectorKit      0x000000011411d10c -[MDDisplayLayer drawToTexture:withTimestamp:completionHandler:prepareHandler:] + 139

27  VectorKit      0x000000011427222f __33-[GGLOpenGLESLayer onTimerFired:]_block_invoke + 87

28  VectorKit      0x0000000114279ad7 _ZN3ggl10OESContext17performWhileBoundEU13block_pointerFvvE + 163

29  VectorKit      0x0000000114271ff7 -[GGLOpenGLESLayer onTimerFired:] + 111

30  VectorKit      0x000000011405f031 _ZN2md9MapEngine11renderSceneEdNSt3__18functionIFvvEEE + 93

31  VectorKit      0x000000011405d8cc _ZN2md9MapEngine18onRenderTimerFiredEd + 158

32  VectorKit      0x00000001142750f8 _ZN3ggl11DisplayLink12onTimerFiredEd + 32

33  VectorKit      0x0000000114274ffa -[_GGLDisplayLinkTarget displayLinkFired:] + 81

34  QuartzCore     0x000000010c268778 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 684

35  QuartzCore     0x000000010c3a4970 _ZL22display_timer_callbackP12__CFMachPortPvlS1_ + 248

36  CoreFoundation 0x000000010f91a9c9 __CFMachPortPerform + 169

37  CoreFoundation 0x000000010f91a909 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41

38  CoreFoundation 0x000000010f91a871 __CFRunLoopDoSource1 + 465

39  CoreFoundation 0x000000010f912654 __CFRunLoopRun + 2596

40  CoreFoundation 0x000000010f9119b9 CFRunLoopRunSpecific + 409

41  GraphicsServices 0x0000000115b389c6 GSEventRunModal + 62

42  UIKit          0x000000010c523948 UIApplicationMain + 159

43  atriptoitaly   0x0000000109f3dfd7 main + 55

44  libdyld.dylib  0x0000000110ab7d81 start + 1) libc++abi.dylib: terminating with uncaught exception of type NSException

Upvotes: 4

Views: 1405

Answers (1)

Giuseppe Sala
Giuseppe Sala

Reputation: 373

Well, looking for a solution i found this in Apple Developer Forum https://forums.developer.apple.com/message/271061#271061

I hope it will be useful to someone

Upvotes: 3

Related Questions