Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pamelaraj

macrumors newbie
Original poster
Apr 8, 2009
6
0
Dear All,

I am implementing a table view with navigation. When the first cell is selected, it must load a second view with navigation enabled to return to the previous view. In my case, when the cell or row is selected in the table, it does not do anything (does not give any error nor shows up a second view). What could I be doing wrong?

here is my code:
-----------------------
-(void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *) indexPath
{
NSUInteger row = [indexPath row];


if(childController == nil)
childController = [[OneView alloc] initWithNibName:mad:"OneView" bundle:nil];
childController.title = @" View Two";
NSString *nameOfRow = [controllers objectAtIndex:row];
NSString *detailedMessage = [[NSString alloc] initWithFormat:mad:"You selected the button for %@", nameOfRow];

childController.message = detailedMessage;
[detailedMessage release];

[self.navigationController pushViewController:childController animated:YES];
[childController release];
}

-----------------------
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.