Browse files

Merge pull request #31 from jwhitehorn/master

Compatibility with UIScrollView
  • Loading branch information...
2 parents cd74d25 + 1292cc7 commit d4bfddc8feb657db90b0c405adb24a19c083c93c @Sephiroth87 committed Sep 19, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 ODRefreshControl/ODRefreshControl.m
View
10 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 d4bfddc

Please sign in to comment.