Chart Exception in Latest (2.5.1) version


#1

Hello,

I have an existing project that works fine in an old version of Charts, upgraded to latest to get iOS 7 support and what worked before no longer works.

Trying to load a bar chart now gives an exception that is near impossible to trace:

2013-09-26 09:08:35.023 Status[54292:a0b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil’

*** First throw call stack:

(

0   CoreFoundation                      0x0308a5e4 __exceptionPreprocess + 180

1   libobjc.A.dylib                     0x029888b6 objc_exception_throw + 44

2   CoreFoundation                      0x0303cc3c -[__NSArrayM insertObject:atIndex:] + 844

3   CoreFoundation                      0x0303c8e0 -[__NSArrayM addObject:] + 64

4   Status                              0x000a66df -[SChartOrderedDictionary setObject:forKey:] + 358

5   Status                              0x0005e15d -[SChartSeries addDataBinWithStartValue:] + 83

6   Status                              0x0005e1a7 -[SChartSeries addDataBinToContainDataPoint:] + 64

7   Status                              0x0005de63 -[SChartSeries addDataPoint:] + 307

8   Status                              0x000a546e -[SChartDataLoader addChartDataPoint:toChartSeries:withIndex:atDataIndex:xAxis:yAxis:] + 229

9   Status                              0x000a3630 -[SChartDataLoader populateChartSeries:atIndex:xAxis:yAxis:] + 841

10  Status                              0x0008183d -[ShinobiChart loadNewChartSeriesEntries] + 1562

11  Status                              0x00088118 -[ShinobiChart layoutSubviews] + 2612

12  UIKit                               0x01765dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355

13  libobjc.A.dylib                     0x0299a81f -[NSObject performSelector:withObject:] + 70

14  QuartzCore                          0x00a9a72a -[CALayer layoutSublayers] + 148

15  QuartzCore                          0x00a8e514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380

16  QuartzCore                          0x00a8e380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26

17  QuartzCore                          0x009f6156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294

18  QuartzCore                          0x009f74e1 _ZN2CA11Transaction6commitEv + 393

19  QuartzCore                          0x009f7bb4 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92

20  CoreFoundation                      0x0305253e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30

21  CoreFoundation                      0x0305248f __CFRunLoopDoObservers + 399

22  CoreFoundation                      0x030303b4 __CFRunLoopRun + 1076

23  CoreFoundation                      0x0302fb33 CFRunLoopRunSpecific + 467

24  CoreFoundation                      0x0302f94b CFRunLoopRunInMode + 123

25  GraphicsServices                    0x02fb59d7 GSEventRunModal + 192

26  GraphicsServices                    0x02fb57fe GSEventRun + 104

27  UIKit                               0x016fb94b UIApplicationMain + 1225

28  Status                              0x00002ed4 main + 164

29  libdyld.dylib                       0x03ae2725 start + 0

)

libc++abi.dylib: terminating with uncaught exception of type NSException

Anyone else get this?  I don’t see it in the forums.

Thanks,

    Rob Bazinet


#2

Hi Rob,

I presume you have solved this by now. If not, I had the same error, it was caused by setting up the chart axis on a view controller init method rather then viewDidLoad.

Andy