You can set your boolean by using:

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"logged_in"];

and read it by using this code:

if(![[NSUserDefaults standardUserDefaults] boolForKey:@"logged_in"]) {
    [self displayLogin];
} else {
    [self displayMainScreen];
}
Advertisements