applicationDidFinishLaunching 未调用
在我的 appdelegate.m 中,未调用 applicationDidFinishLaunching 。 我读到这是由于我的“应用程序”的委托未正确连接,但我不知道如何连接它。我所做的就是右键单击 XIB 文件中的应用程序,然后将委托出口拖到某处......但不知道在哪里。 任何帮助表示赞赏。 谢谢 !
In my appdelegate.m, the applicationDidFinishLaunching is not invoked.
I have read that this is due to the fact my "Application"'s delegate is not properly connected, but I don't know how to connect it. What I do is right-clicking on Application from the XIB file, and drag the delegate outlet somewhere... but don't know where.
Any help appreciated.
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 MainMenu.xib 中,确保存在 AppDelegate 类的实例。要制作一个,请将一个普通对象(蓝色立方体)拖到列表中,并将其类名称设置为 AppDelegate(或任何您的应用程序委托类名称)。
同样在 MainMenu.xib 中,要连接它,请将连接从 Application 对象拖到您的 AppDelegate 实例(蓝色立方体)并将其连接到委托出口。
完毕。
In your MainMenu.xib, make sure there's an instance of your AppDelegate class. To make one, drag a plain object (blue cube) into the list and set its class name to AppDelegate (or whatever your app delegate class name is).
Also in the MainMenu.xib, to connect it, drag a connection from the Application object to your AppDelegate instance (the blue cube) and connect it to the delegate outlet.
Done.
如果您已更新到 Swift 3,可以尝试以下操作:
看一下“AppDelegate.swift”并确保相关行如下所示:
与此相反:
我刚刚更新了一个应用程序,并且没想到查看。结果是我的应用程序启动了,但相关方法从未被调用。显然,您应该检查是否有其他接受通知对象的函数。
Here's something to try if you've updated to Swift 3:
Take a peek at your "AppDelegate.swift" and make sure the relevant line looks like this:
as opposed to this:
I just updated an app, and didn't think to check. The result was that my app launched, but the relevant method was never called. Obviously, you should then check for other functions you have that take Notification objects.