关于这个问题,也是一直困扰我很久的问题了,一直记恨于心啊,终于今天让我知道了,如何解决这个问题啦,哈哈,大笑江湖呀。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIViewController *rootVC;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
if(![[NSUserDefaults standardUserDefaults] boolForKey:@"logged_in"]) {
rootVC=[self.storyboard instantiateViewControllerWithIdentifier: @"vc1"];
} else {
rootVC=[self.storyboard instantiateViewControllerWithIdentifier: @"vc2"];
}
window.rootViewConroller=rootVC;
[self.window makeKeyAndVisible];
return YES;
}

这里面的“vc1”和“vc2”,其实就是storyboard的表示符,自己在创建storyboard的时候一般都会看到的,如果自己还不知道的话,多创建几个自己就知道了。