2011-11-03 69 views
2

我是新來的iPhone應用程序。我被告知不要使用Xcode Storyboard來與iOS4.3兼容。iPhone切換屏幕在xcode 4.2

現在,我有兩頁顯示使用tabcontroller,但是我想添加一個頁面,當程序啓動時加載(即登錄頁面),驗證後用戶將登陸第一頁2個選項卡。

我需要做什麼?我應該創建一個MainWindow.xib文件嗎?

謝謝!

James

+0

我認爲這個問題會幫助你:http://stackoverflow.com/questions/4989130/iphone-login-screen http://stackoverflow.com/questions/3922527/uitabbarcontrol-with-a-login-screen任何懷疑,只問! Arildo –

回答

1

您有(至少)兩種解決方案。您可以:

*在你的AppDelegate創建窗口的didFinishLaunching功能,以類似的東西:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 

    RootViewController *controller = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]; 
    self.navigationController = [[UINavigationController alloc] initWithRootViewController:controller]; 
    self.navigationController.delegate = controller; 
    self.window.rootViewController = self.navigationController; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 

*或者您可以創建的MainWindow.xib與AppDelegate中和窗口文件,並告訴您的應用程序在啓動時使用此筆尖。要這樣做: 在.plist中,輸入MainWindow作爲「主要筆尖文件基本名稱」特性。

+0

謝謝!我製作了MainWindow文件,並像您說的那樣將其指定爲默認文件 –