iOS 从未达到 DidApplicationFinishLaunching.. 从未显示视图

发布于 2024-11-16 12:00:50 字数 579 浏览 2 评论 0原文

我很困惑,我有一个针对 Iphone 的 iOS 应用程序

MainWindow.xib 文件有其窗口和一个设置为从另一个 XIB 文件加载的视图

MainWindow.xib 中的 WINDOW 根本没有连接插座。

这一切之前都在工作,突然停止了,所以我假设 XIB 中的某些内容现在已关闭(引用、代表、某些内容未正确链接)。

View 的 App Delegate 本身连接到 viewController 类。

当应用程序现在启动时,它只显示一个空窗口,并且我的 AppDelegate 类中的 DidApplicationFinishLaunching 永远不会被调用。

我假设我在 Window 和应用程序委托或视图的关联中缺少/损坏了某些内容。

视图是 myViewController 的实例,AppDelegate 设置为 myAppDelegate

但无论我如何将事物与委托出口等链接起来,它都只是坐在那里那里有一扇空白的窗户在嘲笑我。

我知道我搞砸了一些事情,因为这一切都运行得很好,直到 InterfaceBuilder 决定强行一些东西。

非常感谢任何帮助。

I am confused, I have an iOS app targeted for Iphone

The MainWindow.xib file has its Window and a VIEW that is set up to load from another XIB file

The WINDOW in MainWindow.xib has not outlets connected at all.

This was all working before, and suddenly stopped so I am assuming something in the XIB's is now off (references, delegates, something isn't linked right).

The View has its App Delegate connected to the viewController class for itself.

When the application now launches, it just shows an empty WINDOW, and the DidApplicationFinishLaunching in my AppDelegate Class NEVER gets called.

I assume I have something missing/broken in the associations of the Window and the app delegate or views..

The View is an instance of myViewController and AppDelegate is set to myAppDelegate

Yet no matter how I link things up with delegate outlets etc it just sits there with a blank window mocking me.

I know I screwed up something, since this all worked beautifully up until InterfaceBuilder decided to hork something.

Any Help is greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

面犯桃花 2024-11-23 12:00:50

View 的 App Delegate 本身连接到 viewController 类。

呃这句话没有任何意义。视图没有 AppDelegate。

我们通常所说的“AppDelegate”对象就是我们为UIApplication单例对象设置为Delegate的对象。

当您的应用程序启动时,AppDelegate 的 application:didFinishLaunchingWithOptions: 方法不会被神奇地调用:它被调用是因为该对象(类型为 YourAppName_AppDelegate)被设置为 UIApplication 对象的委托;此连接是通过将 UIApplication 实例的“委托”IBOutlet 连接到 YourAppName_AppDelegate 对象在 MainWindow XIB 文件中完成的。

我想对于您的情况,应用程序单例的委托插座和实现 didFinishLaunching 的 AppDelegate 对象之间的连接已损坏,需要重做。

请注意,在 MainWindow.XIB 文件的特殊情况下,由于该 XIB 是应用程序启动时自动打开的 XIB(除非您在 Info.plist 文件中更改了该文件),因此该 XIB 的文件所有者也是UIApplication 单例,以便您可以连接 XIB 中的文件所有者委托 IBOutlet 或 UIApplication 对象委托,因为这是同一个单例对象。

The View has its App Delegate connected to the viewController class for itself.

Errr this sentence does not mean anything. A view does not have an AppDelegate.

The object that we usually call "the AppDelegate" is the object that we set as the Delegate for the UIApplication singleton object.

When your application starts, the application:didFinishLaunchingWithOptions: method of your AppDelegate is not called by magic: it is called because this object (of type YourAppName_AppDelegate) is set as the delegate of your UIApplication object ; this connection is done in your MainWindow XIB file by connecting the "delegate" IBOutlet of the UIApplication instance to the YourAppName_AppDelegate object.

I guess for your case this connection between the app singleton's delegate outlet and the AppDelegate object implementing didFinishLaunching is broken and needs to be redone.

Note that in the special case of the MainWindow.XIB file, as this XIB is the one automatically opened when your application starts (except if you change this in your Info.plist file), the File's Owner of this XIB is also the UIApplication singleton, so that you can connect either the File's Owner delegate IBOutlet or the UIApplication object delegate in your XIB, as this is the same singleton object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文