views:

74

answers:

1

Hi,

I have a UITableView with sections. There's a lot of data in it so there's a lot of scrolling. When I leave the page(viewWillDisappear) I want to be able to 'bookmark' the current top visible section so the user can come back to that section they left off at when they return to the view. I am using scrollToRowAtIndexPath to get there when the view loads but I cannot figure out how to get the index (or position or what?) of the current top visible section when they leave the view (without using didSelectRowAtIndexPath) so I can save it and use it with scrollToRowAtIndexPath when returning.

Can anyone help?

Thanks!!

A: 

UITableView inherits from UIScrollView which has the defined:

- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;
@property(nonatomic) CGPoint contentOffset;

You should be able to use these on the UITableView instance.

pgb
Thanks that worked!!!
GL777