KVO are not deleted when the tableview is delete
2014-07-29 16:20:41.977 RG[15786:60b] An instance 0xe0b6600 of class UITableView was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info: <NSKeyValueObservationInfo 0xc276520> ( <NSKeyValueObservance 0xc276600: Observer: 0xe0b6600, Key path: contentOffset, Options: <New: YES, Old: YES, Prior: NO> Context: 0x253784, Property: 0xc276500> )
I'm also experiencing this problem. Basically an observer is getting set for the floating header (obviously), but doesn't get removed before the tableview is deallocated from the memory. I tried fixing this by implementing a "dealloc" method, or a "remove observer" method inside the floating header's class and having my View Controller call it inside its own "dealloc" or "viewWillDissapear" methods. Sadly, no luck. In all scenarios, either the problem persists, or the app crashes.
Any updates on this?
+1 I am also experiencing this problem
viewWillDisappear is called before memory teardown, so that may be the place to remove whatever is not being removed in the UIViewController.
[self addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew context:IBFloatingHeaderViewContext];
This seems to be the observer that should be removed
Figured it out.
Need this:
-(void)removeContentOffsetObserver { [self removeObserver:self forKeyPath:@"contentOffset" context:IBFloatingHeaderViewContext]; }
Will fork and submit pull request