Crash in [ShinobiChart layoutSubviews]


#1

This is a common crash we are having in the field but we can’t reproduce in the lab or tell where our code is causing the issue. Any insight as to what the problem may be?

Thanks!

Crashed: com.apple.main-thread

EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xa000000c

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x38212b26 objc_msgSend + 5
1  OurApp                     0x000ea791 -[ShinobiChart callDelegateIfResponds:withObject:withObject:]
2  OurApp                     0x000ea7db -[ShinobiChart callDelegateIfResponds:withObject:]
3  OurApp                     0x000e7bbf -[ShinobiChart layoutSubviews]
4  UIKit                          0x30549da3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 346
5  QuartzCore                     0x301d0c6b -[CALayer layoutSublayers] + 142
6  QuartzCore                     0x301cc47b CA::Layer::layout_if_needed(CA::Transaction*) + 350
7  QuartzCore                     0x301cc30d CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
8  QuartzCore                     0x301cbd1f CA::Context::commit_transaction(CA::Transaction*) + 230
9  QuartzCore                     0x301cbb2f CA::Transaction::commit() + 314
10 QuartzCore                     0x301c585d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
11 CoreFoundation                 0x2dda21cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
12 CoreFoundation                 0x2dd9fb71 __CFRunLoopDoObservers + 284
13 CoreFoundation                 0x2dd9feb3 __CFRunLoopRun + 730
14 CoreFoundation                 0x2dd0ac27 CFRunLoopRunSpecific + 522
15 CoreFoundation                 0x2dd0aa0b CFRunLoopRunInMode + 106
16 GraphicsServices               0x32a31283 GSEventRunModal + 138
17 UIKit                          0x305ae049 UIApplicationMain + 1136
18 OurApp                     0x0003ac8f main (main.m:10)


#2

Hi mtuff,

It looks like your losing the reference to your chart’s delegate.

Have you tried keeping a strong reference of your SChartDelegate by storing it as an iVar?

Let me know if this doesn’t solve your issue.

Kind Regards,
Andrew Polkinghorn