[英]iPhone switch screen in xcode 4.2
I am new to iPhone app. 我是iPhone应用程序的新手。 I was told not to use Xcode storyboard for the app to be compatible with iOS4.3 and under.
有人告诉我不要使用Xcode故事板来使该应用程序与iOS4.3及以下版本兼容。
Right now, I have 2 pages showing using a tabcontroller, however I am trying to add a page that loads up first when the program is started (ie a Login page), after authenticated the user will land on the first page of the 2 tabs. 目前,我有2个页面显示使用tabcontroller,但是我尝试添加一个页面,该页面在程序启动时首先加载(即“登录”页面),经过身份验证后,用户将进入2个选项卡的第一页。
What would I need to do? 我该怎么办? Should I create a MainWindow.xib file?
我应该创建MainWindow.xib文件吗?
Thanks! 谢谢!
James 詹姆士
You have (at least) two solutions. 您有(至少)两个解决方案。 You can :
您可以 :
*Create the window the the didFinishLaunching function in your AppDelegate, with something like that: *在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;
}
*or you can create the MainWindow.xib file with the AppDelegate and the window, and tell your app use this nib when launched. *或者您可以使用AppDelegate和窗口创建MainWindow.xib文件,并在启动时告诉您的应用使用此笔尖。 To do that : In the .plist, enter MainWindow for the "Main nib file base name" characteristic.
为此,请执行以下操作:在.plist中,输入MainWindow作为“ Main nib文件的基本名称”特征。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.