如何設置UILocalNotification重複每兩天,每三天等...?沒有使用默認的NSCalendarUnits?如何設置repeatInterval爲每兩天UILocalNotification?
1
A
回答
0
你不能再說一遍,在兩天內,Locallnotification只允許4個的重複間隔
要麼按天,周,月或年,
它的枚舉值,你canat定製它,唯一的解決辦法我看看你是計算時差並比較它兩天的時間,然後嘗試再次設置它
-1
首先,我們必須設置我們將啓動我們的第一個本地通知的NSDate。 一旦通知被調用設置爲下一個通知。
NSDate *afterTwoDays = [[NSDate date] dateByAddingTimeInterval:+2*24*60*60];
設置所需的參數:
UILocalNotification *localNotification=[[UILocalNotification alloc]init];
localNotification.fireDate =afterTwoDays;
localNotification.alertBody = @"Body";
localNotification.alertAction = @"Alert";
localNotification.repeatInterval=0;
localNotification.soundName=UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
相關問題
- 1. 即使在設置RepeatInterval作爲工作日後,UILocalNotification也會每天觸發
- 2. UILocalNotification repeatInterval
- 3. UILocalNotification repeatInterval + applicationIconBadgeNumber
- 4. UILocalNotification with repeatInterval如何設置完成日期?
- 5. 如何設置連續30天的UILocalNotification
- 6. UILocalNotification中的非固定repeatInterval
- 7. 如何在Iphone SDK中將Repeatinterval設置爲兩分鐘?
- 8. iOS UILocalNotification設置爲每天觸發一次,每兩天一次,並且僅在星期日
- 9. 爲UILocalNotification設置fireDate
- 10. UILocalNotification applicationIconBadgeNumber每天不工作
- 11. UILocalNotification repeatInterval打破時區和fireDate
- 12. UILocalNotification - 按repeatInterval復位(不重複)
- 13. UILocalNotification與fireDate過去,但與repeatInterval
- 14. 設置每天
- 15. 如何每兩週通知UILocalNotification
- 16. NSMonthCalendarUnit和NSYearCalendarUnit如何與UILocalNotification repeatInterval一起使用?
- 17. UILocalNotification設置repeatCalendar
- 18. 如何在每隔一天或每隔三天安排一次UILocalNotification?
- 19. 每天消防UILocalNotification,但每天在特定時間
- 20. UILocalNotification在特定的一天如星期天重複,每2周
- 21. UILocalNotification按固定時間每天燃燒
- 22. UILocalNotification計劃每天直到日期
- 23. 如何設置Servicetimer.interval的計時器設置爲每隔15天和每月的最後一天c#
- 24. 如何設置UILocalNotification的到期時間?
- 25. 我可以設置UILocalnotification重複每個月的最後一天嗎?
- 26. 如何設置UILocalNotifications每天每週和每年
- 27. 在本地通知中設置repeatInterval
- 28. 石英:每天運行一次任務,不按repeatInterval
- 29. 每天設置鬧鐘android
- 30. 將每月重置爲每天更改此設置?
你不明白的問題。 – KPM