I'm running into a problem in an app that I'm developing. The user needs to log into a server to get his account information on the iPhone but once he is logged in he won't need to log in again the next launch. Since the login page is the initial view controller I want to be able to segue directly from it to go to a tabController if the user has logged in previously on his phone. In order to do that I store an NSDictionary of userData in NSUserdefaults and when the login view loads I check if there is data in NSUserdefaults. If there is data I try to segue and the performSegueWithIdentifier method gets called but it just doesn't perform the segue. This is all heppening in the loginViewController. Here's my code :
- (void)viewDidLoad
{
[super viewDidLoad];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"user"])
{
self.userData = [defaults objectForKey:@"user"];
[self performSegueWithIdentifier:@"Logged In" sender:self];
}
}
Does any one have ideas on how to solve this issue? Thanks !