2016-12-20 16 views
0

15分ごとに繰り返したいコードにローカル通知を埋め込むようにしています。 NSCalendarUnitのそれは価値、それはNsCalendarUnitを取り、repeatIntervalは時間ではありませんNSCalendarUnitローカル通知15分間隔の問題

UILocalNotification* localNotification = [[UILocalNotification alloc] init]; 
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:30]; 
localNotification.repeatInterval = 900.0; 
localNotification.alertBody = @"Your alert message"; 
localNotification.timeZone = [NSTimeZone defaultTimeZone]; 
localNotification.soundName = UILocalNotificationDefaultSoundName; 
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];  

答えて

1

に15のミントを変換するために、どのように私はのように把握することができません。

これは、でないことを意味します。は15分に間隔を設定します。

repeatIntervalNSCalendarUnitHourの4つの通知を使用し、15分間隔で通知することをお勧めします。

+0

はい、これを実行して正常に動作します。ありがとう – Waqas