私は HomeViewController.m を持っていますself.navigationController
。
SpecificViewController *specificViewController= [[SpecificViewController alloc] initWithNibName:@"SpecificViewController" bundle:nil];
[self.navigationController pushViewController:specificViewController animated:YES];
そして、SpecificViewController.m にサブビューを挿入します
FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
[self.view insertSubview:firstViewController.view atIndex:0];
そして、FirstViewController.m には tableview があります。問題は、navigationController で新しい ViewController をプッシュする方法です。以下で試してみましたが、機能しません。
-(void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailTableViewController *detail =
[[DetailTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.navigationController pushViewController:detail animated:YES];
[detail release];
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}
私はまだ新しい UINavigationController を試しましたが、
UINavigationController *NEWnavigationController;
NEWnavigationController=[[UINavigationController alloc] init];
[NEWnavigationController pushViewController:detail animated:YES];
それでもうまくいきませんでした。何か提案をいただけますか?