2011-12-20 25 views
0

如何設置LocalNotification每兩分鐘重複一次?如何在Iphone SDK中將Repeatinterval設置爲兩分鐘?

以下是我目前的代碼。

localNotification.repeatInterval = NSMinuteCalendarUnit;

是有像

localNotification.repeatInterval = NSMinuteCalendarUnit * 2任何東西;將其設置後調用。

這樣的任何東西都可以使用。

請注意我已經閱讀了幾乎2008年的一篇文章,使其發生,但在那個時候,這是不可用的,少數人請求蘋果這樣做。所以,如果現在這樣。

讓我知道, 感謝 Jigar

回答

0

repeatInterval屬性只能設置爲NSCalendarUnit。 無法將其設置爲2分鐘,因爲這不是NSCalendarUnit

的選項有:

  • NSEraCalendarUnit
  • NSYearCalendarUnit
  • NSMonthCalendarUnit
  • NSDayCalendarUnit
  • NSHourCalendarUnit
  • NSMinuteCalendarUnit
  • NSSecondCalendarUnit
  • NSWeekCalendarUnit
  • NSWeekdayCalendarUnit

或者您可以設置第二個UILocalNotification其中前一後兩分鐘後觸發。

+0

您能否提供我樣品鏈接或代碼? – 2011-12-20 18:28:27

+0

http://developer.apple.com/library/IOs/#documentation/iPhone/Reference/UILocalNotification_Class/Reference/Reference.html – rckoenes 2011-12-21 07:44:46

相關問題