Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unregister before the scroll view is dealloc'ed.

Otherwise we get a nasty message and crash when the scroll view
goes away. Closes #16.
  • Loading branch information...
commit eaa3b55998e4cf9e823d9f58311876334400a750 1 parent 06e26ff
@fernandonf fernandonf authored ppaulojr committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 ODRefreshControl/ODRefreshControl.m
View
9 ODRefreshControl/ODRefreshControl.m
@@ -94,6 +94,15 @@ - (void)dealloc
self.scrollView = nil;
}
+- (void)willMoveToSuperview:(UIView *)newSuperview
+{
+ [super willMoveToSuperview:newSuperview];
+ if (!newSuperview) {
+ [self.scrollView removeObserver:self forKeyPath:@"contentOffset"];
+ self.scrollView = nil;
+ }
+}
+
- (void)setTintColor:(UIColor *)tintColor
{
_tintColor = tintColor;
Please sign in to comment.
Something went wrong with that request. Please try again.