Permalink
Browse files

UIScrollView does not implment numberOfSections

  • Loading branch information...
1 parent cd74d25 commit 1292cc71cb0df02dd1705fe21f4cc76ab5da1b76 @jwhitehorn jwhitehorn committed Sep 18, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 ODRefreshControl/ODRefreshControl.m
@@ -173,10 +173,12 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
if (!_didSetInset) {
_didSetInset = YES;
_hasSectionHeaders = NO;
- for (int i = 0; i < [(UITableView *)self.scrollView numberOfSections]; ++i) {
- if ([(UITableView *)self.scrollView rectForHeaderInSection:i].size.height) {
- _hasSectionHeaders = YES;
- break;
+ if([self.scrollView respondsToSelector:@selector(numberOfSections)]){
+ for (int i = 0; i < [(UITableView *)self.scrollView numberOfSections]; ++i) {
+ if ([(UITableView *)self.scrollView rectForHeaderInSection:i].size.height) {
+ _hasSectionHeaders = YES;
+ break;
+ }
}
}
}

0 comments on commit 1292cc7

Please sign in to comment.