2014-07-22 57 views

回答

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

你不明白的問題。 – KPM

相關問題