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; }