2011-03-07 41 views
1

我有一個標籤欄控制器和加載標籤欄控制器時,我想要做的是加載註冊頁面。這是我的代碼。模式查看問題與標籤欄控制器

RegistrationScreen *registrationScreen = [[RegistrationScreen alloc] initWithNibName:@"RegistrationScreen" bundle:nil]; 
    [self.tabBarController presentModalViewController:registrationScreen animated:FALSE];  
    [registrationScreen release]; 

這工作正常。但在我的註冊頁面中,我有另一種看法,那就是讀我。在點擊註冊頁面中的鏈接後,我需要將其作爲另一個模式視圖加載。然而這並未觸發。我在這裏做錯了什麼?我應該如何在標籤欄控制器上加載多個視圖?

謝謝

+0

你真的應該引用如果你想知道你在做什麼錯不工作的代碼。 – Till 2011-03-07 19:47:06

回答

3

由於RegistrationScreen是一個模式視圖控制器,它不應該有self.tabBarControllerself.navigationController。你可以用NSLog或類似的東西來檢查你自己。它應該有self.parentViewController

RegistrationScreen.m嘗試內:這取決於你如何流作品

[self.parentViewController.tabBarController presentModalViewController:xxxx] 

[self presentModalViewController:xxxx] 

+0

是self.tabBarController不起作用。不過,我試過[自我presentModalViewController:xxxx]但由於在彈出視圖內崩潰的問題,我認爲這也有問題。然而,一旦我解決它最終爲[自我presentModalViewController:xxxx]工作 – Dilshan 2011-03-08 18:09:34

0

TabBarController在AppDelegate文件中聲明。但我不知道如何使用它來顯示標籤欄viewControllers之一中的模式視圖? [self.parentViewController.tabBarController presentModalViewController:XXXX]

我的源代碼的鏈接是here