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.
我有两个问题:
如何在 iPhone 应用程序中开发警报选项?
我们应该能够在应用程序中激活多个警报。我们可以使用 NSTimer、NSThread 等......那么哪个会提供良好的性能?
当应用程序处于前台时,使用 NSTimer 提供计时器滴答声或最终超时值。当应用程序被发送到后台时,您需要设置一个 UILocalNotification,以便在警报剩余时间的情况下发送。
运行每秒执行一次的 NSTimer
NSDate *dateNow = [NSDate date]; if ([dateNow compare:alarm.date] != NSOrderedAscending)
应该管用。