我正在實施一個應用程序,在該應用程序中顯示帶有顯示模式視圖的導航項按鈕的視圖。此模式視圖顯示登錄表單。如果登錄是正確的,我想去另一個視圖顯示一個標籤欄2或3控制器。 到目前爲止,在我的AppDelegate我有:登錄後顯示標籤欄iPhone應用程序
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES; }
,然後在我的RooViewController我有:
- (void)viewDidLoad {
HomeViewController *homeController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
self.controladorVistaHome = homeController;
[self.view addSubview:homeController.view];
[homeController release];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Login" style: UIBarButtonItemStyleBordered target:self action:@selector(showModalLoginForm)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Register" style: UIBarButtonItemStyleBordered target:self action:@selector(showModalRegisterForm)];
[super viewDidLoad]; }
當我點擊登錄按鈕,它讓我看到一個模式與形式查看。一旦用戶登錄,我想用一些控制器顯示一個NAB欄視圖。 如果我修改我的AppDelegate,那麼我到目前爲止不會工作。有沒有辦法做到這一點? 在此先感謝!
在第一次啓動時應該拋棄哪種模式視圖?在我的AppDelegate?通過修改AppDelegate,我感到困惑... – Ruben
所有這些驗證(用戶登錄,用戶註銷...),我應該讓他們在AppDelegate上? – Ruben
不要害怕修改AppDelegate,但我會考慮創建一個UITabBarController子類來處理模式視圖的顯示/解除... –