Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MKMapView _annotationContainer crash

I'm getting what it seems random occuring crashes in the iOS simulator with MKMapView. It's not triggered by any user action, it just happens out of nothing. I'm getting the following stack trace:

<_NSCallStackArray 0x2d9762b0>(
0   ???                                 0x137d69bd 0x0 + 326986173,
1   Foundation                          0x03ca3b0a -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 282,
2   Foundation                          0x03c10b61 _NSGetUsingKeyValueGetter + 81,
3   Foundation                          0x03c1019b -[NSObject(NSKeyValueCoding) valueForKey:] + 260,
4   AccessibilityUtilities              0x11ad1a3f -[NSObject(UIAccessibilitySafeCategory) safeValueForKey:] + 43,
5   MapKitFramework                     0x12090aa4 -[MKBasicMapViewAccessibility(SafeCategory) accessibilityContainerElements] + 91,
6   UIAccessibility                     0x11fc7149 -[NSObject(AXPrivCategory) accessibilityElementCount] + 34,
7   UIAccessibility                     0x11fc751f -[NSObject(AXPrivCategory) _accessibilityHasOrderedChildren] + 59,
8   UIKit                               0x11ebb388 -[UIViewAccessibility(SafeCategory) _accessibilitySubviewsForGettingElementsIncludingContainers:includingOpaqueElementProviders:] + 2269,
9   UIKit                               0x11ebba96 -[UIViewAccessibility(SafeCategory) _accessibilityElementsInContainer:topLevel:includeKB:includeOpaqueElementProviders:] + 486,
10  UIKit                               0x11eba12f -[UIViewAccessibility(SafeCategory) _accessibilityElementsInContainer:topLevel:includeKB:] + 64,
11  UIKit                               0x11eba0ea -[UIViewAccessibility(SafeCategory) _accessibilityElementsInContainer:] + 57,
12  UIKit                               0x11e9b097 -[UIApplicationAccessibility(SafeCategory) _accessibilityElementFirst:last:forFocus:] + 88,
13  UIKit                               0x11e9b936 -[UIApplicationAccessibility(SafeCategory) _accessibilityFirstElement] + 57,
14  UIKit                               0x11e9ea63 -[UIApplicationAccessibility(SafeCategory) accessibilityAttributeValue:] + 333,
15  UIAccessibility                     0x11fbe3b9 _copyAttributeValueCallback + 151,
16  AXRuntime                           0x1201f431 _AXXMIGCopyAttributeValue + 139,
17  AXRuntime                           0x1201a300 _XCopyAttributeValue + 322,
18  AXRuntime                           0x120256c8 mshMIGPerform + 256,
19  CoreFoundation                      0x0447bdd5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53,
20  CoreFoundation                      0x0447bb0b __CFRunLoopDoSource1 + 523,
21  CoreFoundation                      0x044a67ec __CFRunLoopRun + 2156,
22  CoreFoundation                      0x044a5b33 CFRunLoopRunSpecific + 467,
23  CoreFoundation                      0x044a594b CFRunLoopRunInMode + 123,
24  GraphicsServices                    0x04f849d7 GSEventRunModal + 192,
25  GraphicsServices                    0x04f847fe GSEventRun + 104,
26  UIKit                               0x010d294b UIApplicationMain + 1225,
27  Twinkie                             0x000035d4 main + 228,
28  libdyld.dylib                       0x04a3f725 start + 0

When I inspect the registers I see the folowing:

{
    NSTargetObjectUserInfoKey = "<UIView: 0x123dd690; frame = (0 0; 320 568); autoresizesSubviews = NO; gestureRecognizers = <NSArray: 0x253f0270>; layer = <CALayer: 0x123dd6f0>>";
    NSUnknownUserInfoKey = "_annotationContainer";
}

0x123dd690 is a subview of MKMapView, as you can see when doing a recursive description on the MKMapview:

<MKMapView: 0x123dd080; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x1d89c840>; layer = <CALayer: 0x123dd1f0>>
   | <UIView: 0x123dd690; frame = (0 0; 320 568); autoresizesSubviews = NO; gestureRecognizers = <NSArray: 0x253f0270>; layer = <CALayer: 0x123dd6f0>>
   |    | <MKBasicMapView: 0x123dd720; frame = (0 0; 320 568); clipsToBounds = YES; layer = <CALayer: 0x123dd850>>
   |    |    | <_MKMapLayerHostingView: 0x123dd7a0; frame = (0 0; 320 568); layer = <_MKMapLayerHostingLayer: 0x123ddb00>>
   |    |    |    | <VKMapView: 0x123ddf40> (layer)
   |    |    |    |    | <VKMapCanvas: 0x18826ab0> (layer)
   |    |    |    |    |    | <VGLLayer: 0x18824510> (layer)
   |    | <MKScrollContainerView: 0x253499e0; frame = (-407522 -982166; 2.5318e+06 2.5318e+06); autoresizesSubviews = NO; layer = <CALayer: 0x2534d0e0>>
   |    |    | <MKOverlayContainerView: 0x1d8cdef0; frame = (0 0; 2.5318e+06 2.5318e+06); transform = [0.0094316732, 0, 0, 0.0094316732, 0, 0]; layer = <CALayer: 0x1d8cdfc0>> 
etc...

Any pointers how to fix this? Why is it trying to do accessibility stuff?

like image 792
Jorn van Dijk Avatar asked Oct 21 '22 21:10

Jorn van Dijk


1 Answers

I fixed it for now by doing the following:

#if TARGET_IPHONE_SIMULATOR

@interface UIView (FixIt) @end

@implementation UIView (FixIt)

- (id)_annotationContainer
{
    return nil;
}

@end

#endif
like image 149
Jorn van Dijk Avatar answered Oct 27 '22 20:10

Jorn van Dijk