self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; MainUIViewController *vc=[[MainUIViewController alloc]initWithNibName:@"MainUIViewController" bundle:nil]; self.window.rootViewController=vc; [self.window makeKeyAndVisible]; return YES;
Code to create a view.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; // MainUIViewController *vc=[[MainUIViewController alloc]initWithNibName:@"MainUIViewController" bundle:nil];// self.window.rootViewController=vc; RootViewController *rc=[[RootViewController alloc] init]; self.window.rootViewController=rc; [self.window makeKeyAndVisible]; return YES;}
- (void)loadView{ [super loadView]; UIView *view=[[UIView alloc]initWithFrame:[UIScreen mainScreen].applicationFrame]; view.alpha=0.5; view.backgroundColor=[UIColor cyanColor]; self.view=view;}
* @ Author Zhang xingye * http://blog.csdn.net/xyz_lmn* iOS entry group: * android development advanced group: * my Sina Weibo: @ Zhang xingye TBOW*/
Refer:
Https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457-CH1-SW1
Http://xcodev.com/341.html
Http://iostrack.com/post/2012-07-20/40029700941