1.图片的操做过程!git
2.代码github
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *vc=[[UIViewController alloc]initWithNibName:@"vc" bundle:nil]; //ViewController *vc=[[ViewController alloc]initWithNibName:nil bundle:nil]; //ViewController *vc=[[ViewController alloc]init]; self.window.rootViewController=vc; [self.window makeKeyAndVisible]; return YES; }
当没有指定加载哪一个xib时的优先级,而且没有重写loadView时app
在本例中是这样的:当图片中三个xib都存时,默认是加载带controller.xib,也就三者的优先级就出现了.net
当只其中两个的时候,参考第二条,若是没有controller.xib,会加载View.xib3d
代码code
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; // UIViewController *vc=[[UIViewController alloc]initWithNibName:@"View" bundle:nil]; //ViewController *vc=[[ViewController alloc]initWithNibName:nil bundle:nil]; ViewController *vc=[[ViewController alloc]init]; self.window.rootViewController=vc; [self.window makeKeyAndVisible]; return YES; }