I have an application with multiple views. I can click on different buttons to select different views, one of which displays a table. When I select a cell on that row, I want to display a new view. I see a log line indicating that view was loaded, but the screen doesn't change.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *targetCustomCell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSLog(@"in didSelectRowAtIndexPath");
ItemDetailsViewController *detailsController = [[ItemDetailsViewController alloc] initWithNibName:@"ItemDetailsView" bundle:nil];
[self.navigationController pushViewController:detailsController animated:YES];
[self.window addSubview:[detailsController view]];
[detailsController release];
detailsController = nil;
}
In the ItemDetailsViewController, I have
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"in ItemDetailsViewController.viewDidLoad ");
}
I see both log lines, but the screen doesn't change. Why isn't the view changing? Is there some other way to change the view?