Crash with CrossHair


#1

We have a crosshair with custom tooltip.

if the crosshair is visible and re reload the data and re render the chart, sometimes this crash occurs. Any thoughts on how we can avoid this? I have been trying to remove the cross hair before reloading and adding it back afterwards but this is not proving successful. I have even been waiting until -sChartRenderFinished: is called but no luck.

0   libsystem_kernel.dylib               0x0000000199e5bdf8 __abort_with_payload + 8
1   libsystem_kernel.dylib               0x0000000199e55838 abort_with_payload_wrapper_internal + 96
2   libsystem_kernel.dylib               0x0000000199e557d4 abort_with_reason + 32
3   libobjc.A.dylib                      0x00000001994954b4 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 108
4   libobjc.A.dylib                      0x000000019949540c _objc_fatal(char const*, ...) + 40
5   libobjc.A.dylib                      0x00000001994a0b0c lookUpImpOrForward + 808
6   libobjc.A.dylib                      0x00000001994ad098 _objc_msgSend_uncached + 52
7   BICA                                 0x00000001055ea378 -[SChartCartesianHitDetection distanceScalarsInChart:] + 240
8   BICA                                 0x00000001055edbdc -[SChartInterpolatingHitDetection distanceInfoUsingGLToPoint:inChart:isOnlySeries:] + 84
9   BICA                                 0x00000001055ee188 -[SChartInterpolatingHitDetection distanceInfoToPoint:isOnlySeries:chart:] + 116
10  BICA                                 0x0000000105624a8c -[SChartPixelToPointMapper distanceInfoForSeries:binProvider:toPixelPoint:isOnlySeries:chart:] + 840
11  BICA                                 0x0000000105625a28 -[SChartPixelToPointMapper mappingForPoint:lockedToSeries:binProvider:onChart:] + 172
12  BICA                                 0x00000001055c80d8 +[SChartCrosshairSharedUtility mappingForTrackedSeries:locationInChart:isInterpolating:chart:] + 284
13  BICA                                 0x000000010552093c -[SChartCrosshair moveToPoint:inChart:] + 412
14  BICA                                 0x00000001055bcbbc -[SChartCrosshairController repositionCrosshairInChart:] + 100
15  BICA                                 0x000000010558a268 -[SChartCanvasOverlay positionCrosshairIfVisible] + 208
16  BICA                                 0x00000001055a9d8c -[ShinobiChart redrawChartIncludePlotArea:recalcTickLabels:] + 900
17  BICA                                 0x0000000105565c90 -[SChartThemeDecorator applyTheme:toChart:preservingSetValues:] + 508
18  BICA                                 0x00000001055b24e0 -[ShinobiChart applyThemeToChartPreservingSetValues:] + 104
19  BICA                                 0x00000001055ad6ac -[ShinobiChart layoutSubviews] + 1672
20  UIKitCore                            0x00000001c7229998 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1376
21  QuartzCore                           0x000000019e8a9a34 -[CALayer layoutSublayers] + 180
22  QuartzCore                           0x000000019e8ae9c4 CA::Layer::layout_if_needed(CA::Transaction*) + 320
23  QuartzCore                           0x000000019e80d9d4 CA::Context::commit_transaction(CA::Transaction*) + 336
24  QuartzCore                           0x000000019e83c2f4 CA::Transaction::commit() + 604
25  QuartzCore                           0x000000019e83d15c CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 88
26  CoreFoundation                       0x000000019a255b94 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
27  CoreFoundation                       0x000000019a250828 __CFRunLoopDoObservers + 408
28  CoreFoundation                       0x000000019a250dc8 __CFRunLoopRun + 1260
29  CoreFoundation                       0x000000019a2505b8 CFRunLoopRunSpecific + 432
30  GraphicsServices                     0x000000019c4c4584 GSEventRunModal + 96
31  UIKitCore                            0x00000001c6b7b558 UIApplicationMain + 208
32  BICA                                 0x0000000104f0d064 main (main.m:15)
33  libdyld.dylib                        0x0000000199d10b94 start + 0```

#2

Hi @Ants,

To help us see what’s going wrong here, please can you show us the parts of your code which remove and re-add the crosshair?

Thanks,

Alison