I ran into the same problem. While a user registered once needs to redirect to another page, or still need to stay on the main page.
Here is a snippet of code.
Here
N_loginmsg = @"success"; NSString *N_loginmsg = [[NSUserDefaults standardUserDefaults]objectForKey:@"remember_loginmsg"]; NSString *storyboardId; if (N_loginmsg != nil && [N_loginmsg isEqual:@"Success"]) { storyboardId = @"ListViewController"; } else { storyboardId = @"HomeViewController"; } self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil]; UIViewController *initViewController = [storyboard instantiateViewControllerWithIdentifier:storyboardId]; UINavigationController *mynav = [[UINavigationController alloc]initWithRootViewController:initViewController]; self.window.rootViewController = mynav; [self.window makeKeyAndVisible];
source share