gpt4 book ai didi

iphone - 'AppDelegate' 没有可见的@interface 声明选择器

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:15:10 25 4
gpt4 key购买 nike


我现在正在我的 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 中
不幸的是它不起作用。你能帮我解决这个问题吗?

最佳答案

presentModalViewController:animated:UIViewController 类的一个方法。由于应用程序委托(delegate)不是 View Controller ,因此您不能将其发送到此方法。要在屏幕上显示您的第一个 View Controller ,请将其分配给应用程序主窗口的 rootViewController 属性:

self.window.rootViewController = registerView;

关于iphone - 'AppDelegate' 没有可见的@interface 声明选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11122554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com