码迷,mamicode.com
首页 > 其他好文 > 详细

storyboard切换程序进入页面

时间:2015-04-21 09:34:25      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:objectivec   ios   app   

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    if([userDefaults objectForKey:@"autoLogIn"] != nil && [userDefaults objectForKey:@"rand_code"] != nil) {
        UIStoryboard *board = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        //获取故事板中某个View
        UIViewController *next = [board instantiateViewControllerWithIdentifier:@"mainTabBar"];
        [self.window setRootViewController:next];
        [self.window makeKeyAndVisible];
    }else{
        UIStoryboard *board = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        //获取故事板中某个View
        UIViewController *next = [board instantiateViewControllerWithIdentifier:@"mainTabBar"];
        [self.window setRootViewController:next];
        [self.window makeKeyAndVisible];
    }
    return YES;
}

storyboard切换程序进入页面

标签:objectivec   ios   app   

原文地址:http://blog.csdn.net/xiaopeng12300/article/details/45165985

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!