I am trying to get the scroll position of my UITableView
, however when I implement any of the UIScrollViewDelegate
methods, contentOffset
always returns nil for me.
For example:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
NSLog(@"offset: %@", [scrollView contentOffset]);
}
The log returns as offset: (null)
when stopping a scroll motion in the simulator.
I can recreate this with the first example - SimpleTableView - in Apple's TableViewSuite. The RootViewController is a UITableViewController
, and if I place the above method in the implementation file this is what happens. What am I missing here?