笔记:载入viewcontroller的几种方式

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"];
[self.navigationController pushViewController:vc animated:YES];


UIViewController *vc = [[UIViewController alloc] initWithNibName:@"NIBNAME" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];

UIViewController *vc = [[UIViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES];
 
原文地址:https://www.cnblogs.com/sheer-code/p/10689669.html