使用 iPhone 3G 进行多任务处理?

发布于 2024-09-16 22:50:24 字数 441 浏览 8 评论 0原文

我对多任务处理有点困惑。我有一个计时器应用程序,正在为 OS4 更新。以前,您必须保持应用程序运行才能让计时器响起,我现在使用 LocalNotification 对其进行了修改,以便用户退出应用程序,然后在警报触发时收到警报。我已经在 iPhone 4 上对此进行了测试,一切都很好,它按我的预期工作。

然后我在安装了 OS4 的 iPhone 3G 上进行了尝试。现在我认为不支持多任务处理,但如果用户退出应用程序,我的警报仍然会弹出。这是否意味着不支持多任务处理但支持本地通知?我真的不想要这个,因为它会导致几个问题。当我单击警报上的“查看”时,它只会重新启动应用程序,而不会带您进入警报屏幕。更重要的是,您无法取消此警报,并且可能会设置大量令人烦恼和混乱的通知。

有人可以澄清我的想法是正确的吗?基本上我想我想知道如何解决这个问题。我可以做些什么来检查是否支持多任务处理,以便我只能在支持时设置通知?提供搜索内容的线索...谢谢

I'm a bit confused about multitasking. I have a timer app which I am updating for OS4. Previously you had to keep the app running for the timer to sound, I have now modified it using a LocalNotification so that is the user exits the app then they get an alert when the alarm fires. I've tested this on an iPhone 4 and all is good, it works as I expected.

I then tried it on an iPhone 3G with OS4 installed. Now I thought that multitasking wasn't supported but my alert still pops up if the user has exited the app. Does this mean that multitasking isn't supported but local notifications are? I don't really want this as it causes several problems. When I click view on the alert it just relaunches the app, it doesn't take you to the alarm screen. More importantly you can't cancel this alert and could potentially set up lots of notifications which would be annoying and confusing.

Can someone clarify that my thoughts are correct? Basically I guess I want to know how to get around this. Is there something I can do to check if multitasking is supported so I can only set the notification if it is?? A clue of what to search for would do...Thanks

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

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

发布评论

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

评论(1

红颜悴 2024-09-23 22:50:24

多任务处理和本地通知是两个不同的东西。

所有运行 iOS4 的设备都支持本地通知。

为了了解设备是否支持多任务处理,您可以使用

UIDevice* device = [UIDevice currentDevice];
backgroundSupported = NO;
if ([device respondsToSelector:@selector(isMultitaskingSupported)])
backgroundSupported = [device isMultitaskingSupported];

Multitasking and Local Notification are two different things.

Local notifications are supported on every device running iOS4.

In order to know if the device support multitasking or not you can use that

UIDevice* device = [UIDevice currentDevice];
backgroundSupported = NO;
if ([device respondsToSelector:@selector(isMultitaskingSupported)])
backgroundSupported = [device isMultitaskingSupported];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文