标签:style blog color ar sp div c on log
1、storyboard创建
1 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 2 3 self.window.backgroundColor = [UIColor blueColor]; 4 5 UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 6 7 // SDoneViewController *vc = [story instantiateInitialViewController]; 8 9 SDoneViewController *VC1 = [story instantiateViewControllerWithIdentifier:@"two"]; 10 11 self.window.rootViewController = VC1; 12 13 14 [self.window makeKeyAndVisible]; 15 16 return YES;
2、直接创建控制器
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor blueColor]; SDoneViewController *vc = [[SDoneViewController alloc] init]; self.window.rootViewController = vc; [self.window makeKeyAndVisible]; return YES;
3、通过XIB创建控制器
elf.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor blueColor]; SDThreeViewController *three = [[SDThreeViewController alloc] initWithNibName:@"three" bundle:nil]; self.window.rootViewController = three; [self.window makeKeyAndVisible]; return YES;
标签:style blog color ar sp div c on log
原文地址:http://www.cnblogs.com/ndyBlog/p/4005410.html