gsach
gsach

Reputation: 5775

Repeating UILocalNotification behavior when time changes

I am setting a repeating local notification to fire the next Tuesday at 10:00 and then repeat every week (NSWeekCalendarUnit) . My problem is that when the local time changes (2 times per year) the notification will fire at 11:00 or 9:00 o clock. The reason is that NSWeekCalendarUnit is calculated in seconds (7days/week*24hours/day*60seconds/hour). I want the alarm to fire only at 10:00 even if the local time has changed.

Is there any way to accomplish that?

Upvotes: 0

Views: 219

Answers (1)

Martin R
Martin R

Reputation: 539685

Do you set the timeZone property of UILocalNotification? From the documentation:

... If you assign a valid NSTimeZone object to this property, the fire date is interpreted as a wall-clock time that is automatically adjusted when there are changes in time zones; an example suitable for this case is an an alarm clock.

Upvotes: 1

Related Questions