UINavigationController作为App的根视图显示

在AppDelegate文件中指定根视图

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
 {
 
 //TestViewController是一个UIViewController
 
   
*testViewController = [[TestViewController alloc] init];
  UINavigationController *navgitionController = [[UINavigationController alloc] initWithRootViewController:testViewController];
   navgitionController.navigationBarHidden = YES;//全屏显示
   
  self.window.rootViewController
   
  self.window makeKeyAndVisible];






2. 在 TestViewController中实现页面跳转到UITabBarController




*mainController = [[[MainViewController alloc] init] autorelease];
 
  self.navigationController pushViewController:(UIViewController*)mainController animated:YES];
 MainViewController是一个UITabBarController视图,采用pushViewController方式实现页面跳转,跳转时候需要对mainController做强制类型转换成UIViewController