我想在应用程序的开头显示模态视图,但它没有出现。这是我的代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self initDataBase];
CustomerModel *customer = [[[CustomerPersistor alloc] init] getLoggedCustomer];
self.window.rootViewController = self.tabBarController;
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
UIViewController *profileViewController = [[[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil] autorelease];
profileViewController.title = @"Profile";
UINavigationController *profileNavigation = [[[UINavigationController alloc] initWithRootViewController:profileViewController] autorelease];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:profileNavigation, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
if(customer == nil) { NSLog(@"HO");
ViewController *login = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
//login.delegate = self.tabBarController.view;
[self.viewController presentModalViewController:[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] animated:YES];
}
return YES;
}
我该如何解决?