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
"OneView" bundle:nil];
childController.title = @" View Two";
NSString *nameOfRow = [controllers objectAtIndex:row];
NSString *detailedMessage = [[NSString alloc] initWithFormat
"You selected the button for %@", nameOfRow];
childController.message = detailedMessage;
[detailedMessage release];
[self.navigationController pushViewController:childController animated:YES];
[childController release];
}
-----------------------
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
didSelectRowAtIndexPath
{
NSUInteger row = [indexPath row];
if(childController == nil)
childController = [[OneView alloc] initWithNibName
childController.title = @" View Two";
NSString *nameOfRow = [controllers objectAtIndex:row];
NSString *detailedMessage = [[NSString alloc] initWithFormat
childController.message = detailedMessage;
[detailedMessage release];
[self.navigationController pushViewController:childController animated:YES];
[childController release];
}
-----------------------