Login Screen with Storyboarding possible?

后端 未结 4 1218
长发绾君心
长发绾君心 2021-01-30 09:56

I am playing around with the new iOS 5 features and trying to rewriting one of my apps as pure iOS 5 app using the new storyboarding feature.

To cut a long story short,

4条回答
  •  滥情空心
    2021-01-30 10:05

    After trying many different methods, I was able to solve this problem with this:

    -(void)viewWillAppear:(BOOL)animated {
    
        // Check if user is already logged in
        NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
        if ([[prefs objectForKey:@"log"] intValue] == 1) {
            self.view.hidden = YES;
        }
    }
    
    -(void)viewDidAppear:(BOOL)animated{
        [super viewDidAppear:animated];
    
        // Check if user is already logged in
        NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
        if ([[prefs objectForKey:@"log"] intValue] == 1) {
            [self performSegueWithIdentifier:@"homeSeg3" sender:self];
        }
    }
    
    -(void)viewDidUnload {
        self.view.hidden = NO;
    }
    

提交回复
热议问题