I'd like to know if there's a way to get the next fireDate
from the current date.
I have a method that creates the notification and repeats it every time. How do I get the next fireDate
? You would need this 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];
}
}