In my app delegate, I want to display a Sign Up Screen for application first start.
Here is my code :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window.rootViewController = self.tabBarController;
[[[self.tabBarController.tabBar items] objectAtIndex:2] setEnabled:NO];
[[[self.tabBarController.tabBar items] objectAtIndex:3] setEnabled:NO];
if (![self checkAuth]) {
SignupViewController * signUp = [[SignupViewController alloc] initWithNibName:@"SignupView" bundle:nil] ;
[signUp setManagedObjectContext:self.managedObjectContext];
[[self tabBarController] presentModalViewController:signUp animated:YES] ;
[signUp release] ;
}
[self.window makeKeyAndVisible];
return YES;}
Everything works fine, but I don’t want my modalViewController to be animated…
When I change the line :
[[self tabBarController] presentModalViewController:signUp animated:YES] ;
for :
[[self tabBarController] presentModalViewController:signUp animated:NO] ;
My underlying tabBarController is displayed and my modalViewController does not appear !
I spent a lot of time to search someone with a similar problem, but I didn’t found any solution…
Someone can help me please ?
Try to call
[self.window makeKeyAndVisible];before presentModalViewController.