Quote:
Originally Posted by Dan the Man
hello I'm am trying to do 2 things.
I have a Table View and when i click on a cell how can I:
1. get the cell number and alert it in a UIAlertView
2. push the view to the left, to go to a detail View?
|
didSelectRowAtIndex passes in an IndexPath. it has two properties row and section. If you only have one section then the row is the row.
TableViews work with NavigationControllers, when someone selects the row, you create a new viewController and push it onto the nav controller's viewController's stack.
Hope that helps explain it.
Code:
-(void)didSelectRowAtIndexPath:(IndexPath *)indexPath {
int row = [indexPath row];
[someMethodToShowAlert:row];
MyViewController *detailView =[[MyViewController alloc] init…..]
[detailView setDataToPass:dataToPass];
[navController pushViewController:detailView];
[detailView release];
}
Mark