Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UItableviewcontroller中不工作的当前modalviewcontroller的导航控制器_Iphone_Ios_Xcode_Uitableview_Uinavigationcontroller - Fatal编程技术网

Iphone UItableviewcontroller中不工作的当前modalviewcontroller的导航控制器

Iphone UItableviewcontroller中不工作的当前modalviewcontroller的导航控制器,iphone,ios,xcode,uitableview,uinavigationcontroller,Iphone,Ios,Xcode,Uitableview,Uinavigationcontroller,我已经创建了一个具有表视图的应用程序。我需要为此添加标题和后退按钮。这是我在viewcontroller.m文件中的代码 -(IBAction)go:(id)sender{ TableViewController *sec=[[TableViewController alloc]init]; sec.modalTransitionStyle=UIModalTransitionStyleCrossDissolve; [self presentModalViewController:sec an

我已经创建了一个具有表视图的应用程序。我需要为此添加标题和后退按钮。这是我在viewcontroller.m文件中的代码

-(IBAction)go:(id)sender{

TableViewController *sec=[[TableViewController alloc]init];

sec.modalTransitionStyle=UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:sec animated:YES];

self.title=@"test title";

UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:sec];
[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
[sec release];
}

我现在需要添加后退按钮,但我的标题栏不显示。请提供指导。

您想使用导航控制器的“按下…”方法。在应用程序委托中,创建UINavigationController,使其成为窗口的根视图,然后创建UIViewController子类,并使其成为UINavigation控制器的根视图。当此视图出现时,将显示一个UINavigationBar

然后创建这个新的tableview,UIViewController使用

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated

我错过了什么吗?

我试过代码UINavigationController*navigationController;导航控制器=[[UINavigationController alloc]init];[self.view addSubview:navigationController.view];还有导航栏,但它和tableview一起滚动,显示在tableview的中间,隐藏了内容。。。