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
Fatal Exception: NSInternalInconsistencyException
An instance 0x151eabd0 of class UIView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x151b6c10> ( <NSKeyValueObservance 0x14384cd0: Observer: 0x151b0090, Key path: hidden, Options: <New: YES, Old: YES, Prior: NO> Context: 0x151b0180, Property: 0x8814fc0> )
In my view I have this code:
deinit {
stackView.arrangedSubviews.forEach { view in
stackView.removeArrangedSubview(view)
}
}
After investigation I found that method removeArrangedSubview does not call removeHiddenListener. Why?
You are removing listeners by code:
deinit {
// This removes `hidden` value KVO observers using didSet()
{ self.arrangedSubviews = [] }()
}
But arrangedSubviews are already empty. Why don't you remove listeners for all listeners in registeredKvoSubviews array?
The text was updated successfully, but these errors were encountered:
I have a crash:
In my view I have this code:
After investigation I found that method
removeArrangedSubview
does not callremoveHiddenListener
. Why?You are removing listeners by code:
But
arrangedSubviews
are already empty. Why don't you remove listeners for all listeners inregisteredKvoSubviews
array?The text was updated successfully, but these errors were encountered: