CALayer position contains NaN


#1

Hello,

I have an intermittent crash in my iOS ShinobiChart. The trace is below, but from the trace, i can’t tell where to start looking for the issue.  A thought is an invalid number from

- (NSInteger)sChart:(ShinobiChart*)chart numberOfDataPointsForSeriesAtIndex:(NSInteger)seriesIndex

or an invalid data point returned from

- (id<SChartData>)sChart:(ShinobiChart*)chart dataPointAtIndex:(NSInteger)dataIndex forSeriesAtIndex:(NSInteger)seriesIndex

2014-04-07 10:41:21.743 hanna[736:60b] *** Terminating app due to uncaught exception ‘CALayerInvalidGeometry’, reason: 'CALayer position contains NaN: [nan 547.5]'

but i can’t tell and any suggestions are appreciated.

*** First throw call stack:

(

0   CoreFoundation                      0x0000000102bcb495 __exceptionPreprocess + 165

1   libobjc.A.dylib                     0x00000001028f699e objc_exception_throw + 43

2   CoreFoundation                      0x0000000102bcb2ad +[NSException raise:format:] + 205

3   QuartzCore                          0x00000001010f6cf6 _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 158

4   QuartzCore                          0x00000001010f6e77 -[CALayer setPosition:] + 44

5   QuartzCore                          0x00000001010f7544 -[CALayer setFrame:] + 856

6   UIKit                               0x00000001012b9390 -[UIView(Geometry) setFrame:] + 328

7   UIKit                               0x00000001013e849c -[UILabel setFrame:] + 164

8   UIKit                               0x00000001012b22dd -[UIView initWithFrame:] + 111

9   UIKit                               0x00000001013e83b7 -[UILabel initWithFrame:] + 75

10  hanna                               0x00000001000b0e69 -[SChartTickMark initWithLabel:andText:] + 151

11  hanna                               0x00000001000b957a -[SChartAxis createTickMarkWithFrame:withTickMark:forValue:asMajor:shouldCreateLabel:isOverAlternateStripe:shouldUpdateText:] + 3140

12  hanna                               0x00000001000b6626 -[SChartAxis addOrReplaceTickMarkForValue:isMajor:isAlternate:autoCalc:shouldUpdateText:withTickLabelFrame:showLabel:showLabelFrequency:withTickIndex:numberOfGhosts:] + 1918

13  hanna                               0x00000001000b745c -[SChartAxis autoGenerateTickMarks:] + 2022

14  hanna                               0x00000001000b7adb -[SChartAxis generateTickMarks:] + 574

15  hanna                               0x00000001000bae25 -[SChartAxis drawTickMarksWithGLFrame:usingAxisDrawer:needToRedrawLabels:] + 878

16  hanna                               0x00000001000e7f6e -[SChartCanvas layoutSubviews] + 5892

17  UIKit                               0x00000001012ca993 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 354

18  QuartzCore                          0x00000001010ff802 -[CALayer layoutSublayers] + 151

19  QuartzCore                          0x00000001010f4369 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 363

20  QuartzCore                          0x00000001010f41ea _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24

21  QuartzCore                          0x0000000101067fb8 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 252

22  QuartzCore                          0x0000000101069030 _ZN2CA11Transaction6commitEv + 394

23  QuartzCore                          0x000000010106969d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89

24  CoreFoundation                      0x0000000102b96dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23

25  CoreFoundation                      0x0000000102b96d37 __CFRunLoopDoObservers + 391

26  CoreFoundation                      0x0000000102b76522 __CFRunLoopRun + 946

27  CoreFoundation                      0x0000000102b75d83 CFRunLoopRunSpecific + 467

28  GraphicsServices                    0x000000010416bf04 GSEventRunModal + 161

29  UIKit                               0x000000010126ae33 UIApplicationMain + 1010

30  hanna                               0x000000010000dbb5 main + 357

31  libdyld.dylib                       0x00000001038f35fd start + 1


#2

Hi,

Thank you for raising this with us. Would you be able to send over your project, so we can replicate the issue at this end? Once we’ve done that, we should be able to determine what is causing the problem. You can email us at info@shinobicontrols.com.

Many thanks,

Dan