iOS 程序初始一个带导航栏的视图

@synthesize window = _window;
@synthesize rootViewController = _rootViewController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; _rootViewController = [[ViewController alloc] init]; UINavigationController *rootNaviController = [[UINavigationController alloc] initWithRootViewController:_rootViewController]; self.window.rootViewController = rootNaviController;
[self.window makeKeyAndVisible]; return YES;
}

在上述情况下的跳转:

UINavigationController *nav = (UINavigationController*)self.window.rootViewController;
[nav pushViewController:controller animated:YES];
上一篇:ios基础篇(十)——UINavgationController的使用(一)UIBarButtonItem的添加


下一篇:eclipse 使用tomcat运行JavaWeb项目,文件修改后为何不用重启tomcat? (运行web项目的4种方式)探究