NSTimer iPhone 问题

发布于 2024-08-05 06:42:58 字数 148 浏览 2 评论 0原文

我已经看到了我的问题的类似答案,但我只想说清楚。即使应用程序未处于活动状态,我的应用程序也需要发送要触发的事件。我认为使用 NSTimer 无法完成此操作。我的问题是,我是否需要在主运行循环之外的其他运行循环中运行计时器来交付运行循环,以便即使应用程序处于非活动状态,它也会被交付。

I have seen a similar answer for my question but I would just make it clear. My Application needs sends an event to be fired even when the application is not active. I think it cant be done using a NSTimer. My question is that do I need to run the timer in some other runloop other than the main run loop to deliver the runloop, so that it will get delivered even when the application is inactive.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱她像谁 2024-08-12 06:42:58

如果您的意思是应用程序关闭时,则不能。当用户返回主页时,iPhone 应用程序终止,并且没有后台线程保持打开状态。

If you mean when the application is closed, you can't. iPhone applications terminate and there are no background threads left open when the user returns to the main page.

潦草背影 2024-08-12 06:42:58

此外,推送通知实际上不会唤醒应用程序。他们只是在图标上放置一个徽章,并通知用户应用程序有待处理的通知。在用户激活应用程序之前,该应用程序实际上没有机会执行任何操作。

Beside, Push notifications don't actually wake up the application. They just put a badge on the icon and notify the user that the application has notifications pending. The app won't actually get a chance to do anything until the user activates it.

joe

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文