2


在我的 tabBar 出现之前,我现在正在编写一个注册屏幕。我的想法是通过这种方法显示我的注册屏幕(暂时没有关闭功能):

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

Register *registerView =  [[Register alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:registerView animated:YES];

return YES;
}

这在 AppDelegate.m 中
不幸的是它不起作用。你能帮我解决这个问题吗?

4

1 回答 1

3

presentModalViewController:animated:UIViewController类的方法。由于应用程序委托不是视图控制器,因此您不能向它发送此方法。要在屏幕上显示您的第一个视图控制器,请将其分配给您的应用程序主窗口的rootViewController属性:

self.window.rootViewController = registerView;
于 2012-06-20T15:12:22.913 回答