UINavigationController的使用步骤
UINavigationController的使用步骤有三个:
(1)初始化UINavigationController
(2)设置UIWindow的rootViewController为UINavigationController
(3)根据具体情况,通过push方法添加对应个数的子控制器
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
TableViewController *table = [[TableViewController alloc] init];
// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:table];
UINavigationController *nav = [[UINavigationController alloc] init];
self.window.rootViewController = nav;
[nav pushViewController:table animated:YES];
[self.window makeKeyAndVisible];