An crash happened on me since update to xcode6 iOS8. The log is " 2014-09-28 14:53:34.069 ViewDemo[35448:3262351] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7f9750c1c410 of class RedView was deallocated while key value observers were still registered with it. Current observation info: ( Context: 0x0, Property: 0x7f9750c1b910> )' * First throw call stack: (
0 CoreFoundation 0x00000001022e93f5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101f82bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001022e932d +[NSException raise:format:] + 205
3 Foundation 0x0000000101b65af2 NSKVODeallocate + 317
4 UIKit 0x000000010273fc97 -[UIView(Hierarchy) removeFromSuperview] + 633
5 UIKit 0x0000000102733d19 -[UIView dealloc] + 404
6 libobjc.A.dylib 0x0000000101f978cd _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 591
7 CoreFoundation 0x00000001021e0346 _CFAutoreleasePoolPop + 22
8 CoreFoundation 0x0000000102214473 __CFRunLoopRun + 2051
9 CoreFoundation 0x0000000102213a06 CFRunLoopRunSpecific + 470
10 GraphicsServices 0x00000001058b19f0 GSEventRunModal + 161
11 UIKit 0x00000001026d5550 UIApplicationMain + 1282
12 ViewDemo 0x0000000101a53657 main + 103
13 libdyld.dylib 0x0000000104861145 start + 1
) libc++abi.dylib: terminating with uncaught exception of type NSException
"
This is log I reproducted from my demo. It looks like the addObserver action break the relationship about superview and subviews. When the superview dealloc the subviews did not dealloc first.
Did anyone has ides about this?
deallocmethod. - arturdev