How to intercept UIScrollView contentOffset changes from UITableView subclass?

Posted by mystify on Stack Overflow See other posts from Stack Overflow or by mystify
Published on 2010-04-15T10:51:19Z Indexed on 2010/04/15 10:53 UTC
Read the original article Hit count: 642

Filed under:
|

Actually, a UITableView is a UIScrollView (inherits from that). Now, I made a UITableView subclass and added this line of code to it:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    NSLog(@"contentOffset: %@", NSStringFromCGPoint(self.contentOffset));
}

For some reason this is never called when I scroll the table view. But since UITableView has a delegate property on it's own, I assume that it must implement UIScrollViewDelegate protocol and is the delegate for the scroll view itself. Isn't it?

How could I intercept scroll position changes? I want to read them only. Probably I couldn't set them with contentOffset, right?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview