我有3個視圖。presentModalViewController無法正常工作
我要做到以下幾點:
A presents B modally
A dismisses B
A presents C modally
我已經建立了委託模式,其中A是B的代表。這是怎麼了呈現,在b駁回:
[delegate dismissB]; //this is just [self dismissModalViewControllerAnimated:NO]
[delegate presentC]; //this is just [self presentModalViewController:c animated:NO];
出於某種原因,我的應用程序崩潰時我沒有調試結果(我已經NSZombieEnabled)執行該代碼。
當我評論出[delegate presentC]
該應用程序將正確解僱B. 當我註釋掉[delegate dismissB]
時,應用程序不執行任何操作,即使該行執行。我不知道爲什麼?
UPDATE: 這裏是一個
-(void)showARView{
[self dismissModalViewControllerAnimated:NO];
ARViewController* arViewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil]autorelease];
UINavigationController *arNavController = [[UINavigationController alloc] initWithRootViewController:arViewController];
LeaderBoardTableViewController* lbViewController = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease];
lbViewController.title = @"Leaderboard";
UINavigationController *lbNavController = [[UINavigationController alloc] initWithRootViewController:lbViewController];
arTabBarController = [[UITabBarController alloc] init];//initWithNibName:nil bundle:nil];
arTabBarController.delegate = self;
arTabBarController.viewControllers = [NSArray arrayWithObjects:arNavController, lbNavController, nil];
arTabBarController.selectedViewController = arNavController;
[arNavController release];
[lbNavController release];
[self presentModalViewController:arTabBarController animated:NO];
}
代碼在這裏在B
[delegate showARView];
嗨希恩你能解決這個問題嗎,我也面臨同樣的問題。如果你分享解決方案 – 2012-06-18 15:53:50