You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm adding a BarChartView to a CollectionView-like class that deallocates and reuses cells. I add to one of these cells a BarChartView, and when you scroll up and down, the app crashes with this error:
The chart view removes any observes (to be exact: 2) that it registers (in init) - in dealloc, so I'm guessing there's a problem in your code in another place....
I'm adding a BarChartView to a CollectionView-like class that deallocates and reuses cells. I add to one of these cells a BarChartView, and when you scroll up and down, the app crashes with this error:
App Crash:
An instance 0x7cba6e00 of class Charts.BarChartView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x7e4626a0> (
<NSKeyValueObservance 0x7c0d6090: Observer: 0x7cba6e00, Key path: bounds, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7c0d60c0>
<NSKeyValueObservance 0x7c0cb910: Observer: 0x7cba6e00, Key path: frame, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7c0cb940>
)
2016-08-28 20:06:01.937 VirtualStatBasic[14383:2869686] Stack Trace:
(
0 CoreFoundation 0x055a8494 exceptionPreprocess + 180
1 libobjc.A.dylib 0x05062e02 objc_exception_throw + 50
2 CoreFoundation 0x055a83bd +[NSException raise:format:] + 141
3 Foundation 0x04c9b097 NSKVODeallocate + 353
4 UIKit 0x03fd6348 -[UIView(UIKitManual) release] + 142
5 CoreFoundation 0x05457df7 CFRelease + 727
6 CoreFoundation 0x0546dbfe -[__NSArrayM dealloc] + 142
7 libobjc.A.dylib 0x05076060 _ZN11objc_object17sidetable_releaseEb + 238
8 libobjc.A.dylib 0x05075361 objc_release + 65
9 libobjc.A.dylib 0x0507652d _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 371
10 CoreFoundation 0x054788a8 _CFAutoreleasePoolPop + 24
11 Foundation 0x04c6e23f __NSFireDelayedPerform + 520
12 CoreFoundation 0x054f2136 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 22
13 CoreFoundation 0x054f1b32 __CFRunLoopDoTimer + 1250
14 CoreFoundation 0x054b039a __CFRunLoopRun + 2202
15 CoreFoundation 0x054af846 CFRunLoopRunSpecific + 470
16 CoreFoundation 0x054af65b CFRunLoopRunInMode + 123
17 GraphicsServices 0x0ad41664 GSEventRunModal + 192
18 GraphicsServices 0x0ad414a1 GSEventRun + 104
19 UIKit 0x036e6eb9 UIApplicationMain + 160
20 VirtualStatBasic 0x00008e0a main + 138
21 libdyld.dylib 0x05a54a25 start + 1
)
I believe the deallocation of cell-like objects containing the BarChartView might be causing the problem.
What would you suggest? Is there a way to remove the Key Value Observers?
The text was updated successfully, but these errors were encountered: