Crash, when trying to display crosshair tooltip


#1

Crash happens on LongPress, callstack:

Thread 1, Queue : com.apple.main-thread
#0	0x39e0e6a0 in objc_exception_throw ()
#1	0x2f69ad94 in -[__NSArrayM objectAtIndex:] ()
#2	0x00082bbc in -[SChartCanvasOverlay positionCrosshairAtPosition:onSeries:onDatapoint:] ()
#3	0x00082f94 in -[SChartCanvasOverlay positionCrosshairFromGesture:gestureJustStarted:] ()
#4	0x00085f12 in -[SChartCanvasOverlay handleLongPressGesture:] ()
#5	0x3206f738 in _UIGestureRecognizerSendActions ()
#6	0x31f1a18a in -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] ()
#7	0x322a5d4e in ___UIGestureRecognizerUpdate_block_invoke ()
#8	0x31ee15ce in _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks ()
#9	0x31edfd32 in _UIGestureRecognizerUpdate ()
#10	0x2f72ff68 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#11	0x2f72d8f6 in __CFRunLoopDoObservers ()
#12	0x2f72dc42 in __CFRunLoopRun ()
#13	0x2f698470 in CFRunLoopRunSpecific ()
#14	0x2f698252 in CFRunLoopRunInMode ()
#15	0x3439f2ea in GSEventRunModal ()
#16	0x31f4d844 in UIApplicationMain ()

Terminating app due to uncaught exception ‘NSRangeException’, reason: '*** -[__NSArrayM objectAtIndex:]: index 2005 beyond bounds [0 … 9]'

Version 2.5.7
Code

    _chart.crosshair.hidden = NO;

    [_chart.crosshairsetDefaultTooltip];

 


#2

Hi crypozza,

I am unable to replicate the crash you described.

To display your crosshair all you need to do is set the “crosshairEnabled” property on your series to YES like so:

series.crosshairEnabled = YES;

This should make the default crosshair appear on your chart.

Let me know if your crash persists.

Kind Regards,
Andrew Polkinghorn


#3

Hi Crypozza,

We have had issues with crosshairs in previous versions of ShinobiCharts, but they should have been fixed in version 2.5.7. Is it possible that Xcode is picking up an old version of the ShinobiCharts framework from somewhere on your machine? If you call getInfo on an instance of a ShinobiChart, what version information is returned?

Regards,

Dan