So im trying to skip my first viewcontroller if a NSUserDefaults key is found. But its not working. Is it smart to use a Segue for this? Im new to storybord.
Warning: Attempt to present on whose view is not in the window hierarchy!
Im using this code in the viewDidLoad of the first VC:
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"])
{
NSLog(@"not first launch");
[self performSegueWithIdentifier:@"SegueToNewTrackTraceVC" sender:self];
}else{
NSLog(@"First launch");
}
NSLog(@"initialViewController loaded");
}
You forgot to update the
NSUserDefaultafter the first launch.