2011-11-03 169 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文件,并像您说的那样将其指定为默认文件 –