xcode版本
1. 纯代码创建方式
ST_AViewController *vc = [[ST_AViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
- AViewController push到BViewController
ST_BViewController *vc = [[ST_BViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
- BViewController pop 回到AViewController
2. xib创建方式
command+N创建ViewController的时候勾选了Also create XIB file ,创建了ViewController同名的XIB文件
ST_AAViewController *vc = [[ST_AAViewController alloc] initWithNibName:@"ST_AAViewController" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
此种方式创建也可以用下面这种方式加载
ST_AViewController *vc = [[ST_AViewController alloc] init];
但是不要重写 loadView 方法,若是重写了loadView,那么控制器就是漆黑一片;
第二部分