// 如果因爲內存等原因,應用程序被操作系統幹掉,再次點擊圖標,會調用此方法!
{
// 實例化UIWindow,特殊的UIView
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
// 設置窗口的背景顏色
self.window.backgroundColor = [UIColor whiteColor];
UIStoryboard*storyboard = [UIStoryboard storyboardWithName:@"Test" bundle:nil]; //bundle 傳nil 默認就是main bundle
2、接着初始化storyboard中的控制器
添加標識符在strohboard中
self.window.rootViewController = ;mj
// 讓窗口變成主窗口並且可見
[self.window makeKeyAndVisible];
return YES;
}
// 如果因爲內存等原因,應用程序被操作系統幹掉,再次點擊圖標,會調用此方法!
{
// 實例化UIWindow,特殊的UIView
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
// 設置窗口的背景顏色
self.window.backgroundColor = [UIColor whiteColor];
// 實例化視圖控制器
CZViewController *mj = [[CZViewController alloc] init];
// 將視圖控制器的視圖添加到窗口,這句話,已經不用了
// [self.window addSubview:vc.view];
self.window.rootViewController = mj;
// 讓窗口變成主窗口並且可見
[self.window makeKeyAndVisible];
return YES;
}
// 如果因爲內存等原因,應用程序被操作系統幹掉,再次點擊圖標,會調用此方法!
{
// 實例化UIWindow,特殊的UIView
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
// 設置窗口的背景顏色
self.window.backgroundColor = [UIColor whiteColor];
// 加載指定的xib文件
MJThreeViewController *mj = [[MJThreeViewController alloc] initWithNibName:@"MJView" bundle:nil];
self.window.rootViewController = mj;
// 讓窗口變成主窗口並且可見
[self.window makeKeyAndVisible];
return YES;
}