如何使用iPhone SDK 4.0实现警报 [英] How to implement an alarm with iPhone SDK 4.0

查看:207
本文介绍了如何使用iPhone SDK 4.0实现警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于iPhone的非常不寻常的闹钟的想法。但到目前为止,我对如何实现这一点有一些想法。首先:暂时忘记后台服务,如何实现触发警报的实际计时器等?一个单独的线程?或者SDK是否包含我错过的任何好的警报功能?因为我需要尽可能提高电池效率。但是现在我没有后台程序。

I have an idea for a pretty unusual alarm clock fir the iPhone. But as of now I have some thoughts on how to actually implement this. First off: forgetting about background services for now, how would I do the actual timer that fires the alarm etc? A separate thread? Or does the SDK include any nice alarm features I missed? Of cause I need to be as battery efficient as possible. But for now I do no background process.

请告诉我这个,因为它是这个应用程序的一个关键概念,如果它能够工作或不工作。

Please advise me on this as it is a crucial concept of this app, if it will work or not.

推荐答案

我会创建一个本地通知。与 NSTimer 相比,本地通知的优势在于无论您的应用是否正在运行,它们都能正常运行。

I would create a local notification. Compared to NSTimer, local notifications have the advantage that they work regardless of whether your app is running or not.

这篇关于如何使用iPhone SDK 4.0实现警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆