Skip to content

Commit

Permalink
Fixed a potential KVO crash.
Browse files Browse the repository at this point in the history
The contentSize keypath should also be removed when showsPullToRefresh is set to NO.
  • Loading branch information
nonamelive committed Jun 17, 2013
1 parent 5b98a05 commit 1145eed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions SVPullToRefresh/UIScrollView+SVPullToRefresh.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ - (void)setShowsPullToRefresh:(BOOL)showsPullToRefresh {
if(!showsPullToRefresh) {
if (self.pullToRefreshView.isObserving) {
[self removeObserver:self.pullToRefreshView forKeyPath:@"contentOffset"];
[self removeObserver:self.pullToRefreshView forKeyPath:@"contentSize"];
[self removeObserver:self.pullToRefreshView forKeyPath:@"frame"];
[self.pullToRefreshView resetScrollViewContentInset];
self.pullToRefreshView.isObserving = NO;
Expand Down

0 comments on commit 1145eed

Please sign in to comment.