0
I wonder if there’s a way to catch the next fireDate
from the current date.
I have a method that creates the notification and repeats it every given period. How do I catch the next fireDate
? I would need that to display in a string.
- (void)criarNotificacao {
NSDate *novaData = self.data;
for (int i = 0; i < (24/self.intervalo); i++) {
UILocalNotification *notificacao = [[UILocalNotification alloc] init];
notificacao.fireDate = novaData;
notificacao.alertBody = self.nome;
notificacao.soundName = UILocalNotificationDefaultSoundName;
notificacao.timeZone = [NSTimeZone defaultTimeZone];
notificacao.repeatInterval = NSCalendarUnitDay;
notificacao.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication] scheduleLocalNotification:notificacao];
novaData = [NSDate dateWithTimeInterval:(self.intervalo*3600) sinceDate:novaData];
}
}