iOS 加载Viewcontroller的几种方法
// 一、根据StoryboardID(需要在Storyboard设置),通过ViewController所在的Storyboard来加载: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"FicowVC"]; // 二、通过UIViewController对应的.xib文件加载: UIViewController *vc = [[UIViewController alloc] initWithNibName:@"FicowVC" bundle:nil]; // 三、直接加载UIViewController类: UIViewController *vc = [[UIViewController alloc] init]; /* 注意: loadNibNamed和initWithNibName需要加载的xib文件是不一样的。 initWithNibName需要加载的xib文件的File Owner应改是需要加载的类, 而loadNibNamed需要加载的xib文件的File Owner为NSObject。 */
Stay hungry,stay foolish.