That's the code from viewDidLoad in the main view controller:
Code:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *userNameTemp = [prefs stringForKey:@"UserName"];
if (userNameTemp == nil){
[self presentModalViewController:editViewController animated:YES];
NSLog(@"I'm inside");
}
Even though the condition is met, view doesn't change. Why is that? I get no errors, no warnings and [self presentModalViewController:editViewController animated:YES]; works in another function (when it's invoked by button). Any tips?