【发布时间】:2011-02-27 19:29:35
【问题描述】:
我对 iPhone 还很陌生。我有一个特殊的问题。我正在将视图控制器作为子视图添加到当前视图。然后我想从中推送一个新的视图控制器。问题是当我尝试执行 pushViewController 时,它没有响应。
例如,在 CurrentViewController 中我添加了 NewViewController 的视图作为子视图
[self.view addSubView : NewViewController.view]
现在在 NewViewController 中,单击一个按钮,我正在执行以下操作:
SecondViewController *secondVC = [SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:secondVC animated:YES];
这里第二个VC没有被压入堆栈。
【问题讨论】:
-
子视图会有导航控制器吗?
-
@Jayashree。您是否使用过视图控制器应用程序或基于导航的应用程序?
-
@Pugal : CurrentViewController 和 NewViewController 是基于视图的,而 SecondViewController 是基于导航的应用程序
标签: iphone uinavigationcontroller addsubview