Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KVO bug when ScrollView is dealloced #142

Open
jonasman opened this issue Aug 13, 2013 · 3 comments
Open

KVO bug when ScrollView is dealloced #142

jonasman opened this issue Aug 13, 2013 · 3 comments

Comments

@jonasman
Copy link

When my UITableView is dealloced i get this error:

An instance 0x17adda00 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 0x18f47240> (
<NSKeyValueObservance 0x18f47070: Observer: 0x18f46190, Key path: contentSize, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x18be8b40>
)

The observer is not being removed because there is no dealloc method

@MaximKeegan
Copy link

Same issue...

@marcelofabri
Copy link
Contributor

To force removing the observer, you can add this to your View Controller subclass:

- (void)dealloc {
    self.tableView.showsInfiniteScrolling = NO;
    self.tableView.showsPullToRefresh = NO;
}

@aryaxt
Copy link

aryaxt commented Jul 8, 2016

this was happening to me because I was conditionally calling addInfiniteScrollingWithActionHandler but always called showsInfiniteScrolling. In cases where addInfiniteScrollingWithActionHandler was not called it would cause a crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants