0 我有一个持续执行函数的计时器,但只要用户退出应用程序,更改到其他视图或关闭应用程序,它就会停止。我如何保持计时器在每种情况下都处于活动状态并运行?如何让计时器在后台运行? 来源 2017-07-03 bigreddawg +1 你有没有看过“相关”的问题,如https://stackoverflow.com/questions/34850390/ios-timer-in-the-background?rq=1m,https://stackoverflow.com/questions/40644452/running-a-timer-that-counts-down-in-background-when-app-is-the-focus-swift?rq = 1,https://stackoverflow.com/questions/41645143/time -app-can-run-in-background-swift?rq = 1,https://stackoverflow.com/questions/44416417/should-i-invalidate-timer-when-my-application-is-suspended-or-in -Background?RQ = 1? – +1 timer.invalidate()没有调用并请参阅此https://stackoverflow.com/questions/8415870/scheduled-nstimer-when-app-is-in-background – +0 你有没有得到这个工作为你的应用程序? – WBuck
你有没有看过“相关”的问题,如https://stackoverflow.com/questions/34850390/ios-timer-in-the-background?rq=1m,https://stackoverflow.com/questions/40644452/running-a-timer-that-counts-down-in-background-when-app-is-the-focus-swift?rq = 1,https://stackoverflow.com/questions/41645143/time -app-can-run-in-background-swift?rq = 1,https://stackoverflow.com/questions/44416417/should-i-invalidate-timer-when-my-application-is-suspended-or-in -Background?RQ = 1? –
timer.invalidate()没有调用并请参阅此https://stackoverflow.com/questions/8415870/scheduled-nstimer-when-app-is-in-background –
你有没有得到这个工作为你的应用程序? – WBuck