gpt4 book ai didi

iOS applicationWillEnterBackground 在哪里定义?什么时候叫?

转载 作者:行者123 更新时间:2023-11-28 18:40:21 25 4
gpt4 key购买 nike

可能是一个新手问题:我正在处理一些具有实现的遗留代码

- (void)applicationWillEnterBackground:(UIApplication *)application

header 中没有此方法的明确定义,因此我假设它是采用的协议(protocol) (UIApplicationDelegate) 的一部分,但它未包含在苹果的文档中。

此方法是否作为应用生命周期的一部分被调用? (毕竟该方法的名称非常类似于 applicationDidEnterBackground,它被列为 UIApplicationDelegate 方法)

如果它是生命周期的一部分,什么时候调用?

最佳答案

字符串 applicationWillEnterBackground 没有出现在 UIKit 动态库中。我很确定系统永远不会发送该消息。

:; strings - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit | grep applicationWillEnterBackground

为了比较,该库确实包含字符串 applicationDidEnterBackground:

:; strings - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit | grep applicationDidEnterBackground
applicationDidEnterBackground:
_applicationDidEnterBackground:
-[UIActivityIndicatorView _applicationDidEnterBackground:]

关于iOS applicationWillEnterBackground 在哪里定义?什么时候叫?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11803011/

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