1,代码
UIViewController *vc = [[UIViewController alloc] init];
2,storyboard
1> 先加载storyboard文件(Test是storyboard的文件名)
UIStoryboard *storyboard
= [UIStoryboard storyboardWithName:@"Test" bundle:nil];
2> 接着初始化storyboard中的控制器(箭头所指的控制器)
UIViewController *vc = [storyboard instantiateInitialViewController];
3> 或者通过一个标识初始化对应的控制器
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@”ID"];
3,xib
UIViewController *vc = [[UIViewController alloc] initWithNibName:@"ZZViewController" bundle:nil];