gpt4 book ai didi

iPhone 模拟器和 applicationWillTerminate()

转载 作者:行者123 更新时间:2023-12-03 18:28:03 26 4
gpt4 key购买 nike

当我的应用程序在 iPhone 模拟器中运行时,委托(delegate)方法

- (void)applicationWillTerminate:(UIApplication *)application

仅在我第一次按下 iPhone 模拟器的主页按钮时调用。

按下主页按钮并再次启动应用程序后,点击主页按钮不会调用委托(delegate)方法。

这是怎么回事?我是否误解了一些基本的东西?

最佳答案

我怀疑它正在被调用,但是您感到困惑,因为在您点击模拟器中的“主页”按钮后,您已经结束了 Xcode 中的当前 session 。您的 applicationWillTerminate: 方法中可能有一个 NSLog ,是吗?单击“主页”按钮后,NSLog 将不再显示在 Xcode 的运行控制台中。如果您打开 /Applications/Console.app 我希望它们会出现在那里。

关于iPhone 模拟器和 applicationWillTerminate(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/368021/

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