菜鸟教程小白 发表于 2022-12-13 14:14:50

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


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

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

Register *registerView =[ initWithNibName:nil bundle:nil];
;

return YES;
}
</code></pre>

<p>在 AppDelegate.m 中 <br/>
不幸的是,它不起作用。你能帮我解决这个问题吗?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p><code>presentModalViewController:animated:</code> 是 <code>UIViewController</code> 类的方法。由于应用程序委托(delegate)不是 ViewController ,因此您不能向它发送此方法。要在屏幕上显示您的第一个 ViewController ,请将其分配给应用程序主窗口的 <code>rootViewController</code> 属性:</p>

<pre><code>self.window.rootViewController = registerView;
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于iphone -&#39;AppDelegate&#39; 没有可见的@interface 声明选择器,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/11122554/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/11122554/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - &#39;AppDelegate&#39; 没有可见的@interface 声明选择器