标签:
(1)sb // 传niu就相当于[NSBundle mainbundle]; UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MYStoryBoard" bundle:nil]; self.window.rootViewController = [sb instantiateInitialViewController]; (2)sb+可重用标示 UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MYStoryBoard" bundle:nil]; UIViewController *control = [sb instantiateViewControllerWithIdentifier:@"MYSB"]; (3)xib : xib需要一个输出口 MYViewController *con = [[MYViewController alloc] initWithNibName:@"MYViewController" bundle:nil]; self.window.rootViewController = con; (4)纯代码
// 1.纯代码 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor clearColor]; self.window.rootViewController = [[ViewController alloc] init]; [self.window makeKeyAndVisible];
标签:
原文地址:http://www.cnblogs.com/aixiaoxin/p/4948974.html