Hi,
I'm trying to create a local notification that will fire at a certain hour and repeat every minute. This is what I have now:
Code:
UIApplication *app = [UIApplication sharedApplication];
UILocalNotification *notification = [[UILocalNotification alloc] init] ;
notification.soundName = UILocalNotificationDefaultSoundName;
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *dateComps = [[NSDateComponents alloc] init];
[dateComps setHour:18];
[dateComps setMinute:0];
[dateComps setSecond:0];
notification.alertBody = @"alerted";
notification.fireDate = [calendar dateFromComponents:dateComps];
notification.timeZone = [calendar timeZone];
[dateComps release];
notification.repeatInterval = NSMinuteCalendarUnit;
notification.repeatCalendar = [NSCalendar currentCalendar];
[app scheduleLocalNotification:notification];
[notification release];
The notification fires about a minute after I run the app, long before the scheduled time. What's bizarre is that even when I close the app entirely - double-click the home button and tap the "no entry" button - the notifications keep appearing.
Thanks,
Nir.