本文介绍了uilocalnotification没有在正确的时间触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中实现uilocalnotification.但是问题在于它没有在正确的时间触发.从给定的发射时间开始30到40秒后开始发射.是我缺少的东西,还是UILocalNotification中的普遍想法.

I want to implement uilocalnotification in my app. but the problem is that it is not firing at the exact time. it is firing after 30 - 40 secs from the given firing time.Is there something I am missing or this is a common think in UILocalNotification.

谢谢

推荐答案

UILocalNotification专为将来发生的事情而设计,因此30秒的错误就可以了(即,如果我在15:00开会,那么在15:00:30告诉我没问题:)

UILocalNotification is designed for things that are happening far in the future so an error of 30 seconds would be OK (i.e. if I had a meeting at 15:00 then telling me at 15:00:30 wouldn't be a problem :)

如果您想获得更高的准确性,则需要保持应用程序运行并使用NSTimer.

If you want more accuracy than that you will need to keep your app running and use an NSTimer.

这篇关于uilocalnotification没有在正确的时间触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 13:26