Я использую приведенный ниже фрагмент кода, чтобы запланировать локальное уведомление в определенное время. Но уведомление повторяется каждую минуту, а не через день. Пропустил ли я какие-либо настройки уведомлений. Мой часовой пояс (Азия/Калькутта (IST) смещение 19800) и я использую iPhone 4s.
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar] ;
NSDate *now = [NSDate date];
NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:now];
[components setHour:12];
[components setMinute:00];
UILocalNotification *notification = [[UILocalNotification alloc]init];
notification.fireDate = [calendar dateFromComponents:components];
[notification setAlertBody:@"U got notification!!!"];
// notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
}