如何在Xcode4 for iPhone app中添加初始视图

时间:2012-09-10 13:42:23

标签: iphone ios xcode4 uiviewcontroller

我的游戏应用程序目前只有一个ViewController和XIB用于玩游戏。 我为初始(启动)视图添加了一个新的ViewController和XIB。

如何让应用启动此初始视图?我无法理解。

仅供参考,初始屏幕适用于不错的欢迎图形和一些设置控件。

2 个答案:

答案 0 :(得分:1)

在appDelegate的功能

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

 //DesiredStartUpViewController is the class which u wanna call at start up
 DesiredStartUpViewController * yourDesiredViewController = [[DesiredStartUpViewController alloc]initWithNibName:@"YourDesiredViewController"];

 UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:yourDesiredViewController];

 [self.window setRootViewController:navigationController];
 [self.window makeKeyAndVisible];

}

答案 1 :(得分:0)

转到项目设置选择目标。然后单击“摘要”,您必须在下面设置启动画面。它将显示为加载屏幕。