diff --git a/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m b/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m index e43490ec..ab9e38f9 100644 --- a/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m +++ b/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m @@ -83,6 +83,10 @@ - (SVInfiniteScrollingView *)infiniteScrollingView { } - (void)setShowsInfiniteScrolling:(BOOL)showsInfiniteScrolling { + + if (!self.infiniteScrollingView) + return; + self.infiniteScrollingView.hidden = !showsInfiniteScrolling; if(!showsInfiniteScrolling) { diff --git a/SVPullToRefresh/UIScrollView+SVPullToRefresh.m b/SVPullToRefresh/UIScrollView+SVPullToRefresh.m index ba19078c..e74b358c 100644 --- a/SVPullToRefresh/UIScrollView+SVPullToRefresh.m +++ b/SVPullToRefresh/UIScrollView+SVPullToRefresh.m @@ -115,6 +115,10 @@ - (SVPullToRefreshView *)pullToRefreshView { } - (void)setShowsPullToRefresh:(BOOL)showsPullToRefresh { + + if (!self.pullToRefreshView) + return; + self.pullToRefreshView.hidden = !showsPullToRefresh; if(!showsPullToRefresh) {