Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当一个 iOS 应用程序被唤醒时,会调用 applicationDidBecomeActive 委托。
如果设备连接到调试器,则应用程序将永远不会休眠。
如何调试唤醒代码中的问题?
只需将您的 applicationDidBecomeActive 委托给其他方法并对其进行单元测试。您正在测试您的代码,而不是 Apple 的唤醒回调机制。