tags:

views:

22

answers:

2

hi guys, i was wondering how do i do this? I wish to make a tableview configured in a way that if i scroll down a tableview and click on one row, i will be brought to another view. But when i click a back button of some sort. i return to the tableview but still viewing that particular row. kinda like the iPod table in the iPhone? Remembering scrolled position?

i just want to know how to do the 'remembering scrolled position' part.

A: 

Save your index path in tableView:didSelectCellAtIndexPath: before pushing the new view, use it later. This will give you the NSIndexPath pointing at the cell that was selected by the user, not necessarily give you the same position it was at before they tapped the item. So keep that in mind.

jer
how and where do i use the indexPath?
Kenneth
As vodkhang said above, use selectRowAtIndexPath:animated:scrollPosition: (he provided a link)
jer
ok i'll give it a try. any sample codes tho?
Kenneth
A: 

Continue from jer's answer. You can use indexPath when calling this method in tableView:

UITableView selectRowAtIndexPath:animated:scrollPosition:

vodkhang
hmm any sammple codes?
Kenneth
Can you just try it first? I think that it is too easy to find a example
vodkhang