我正在设置重复本地通知,在下周二 10:00 触发,然后每周重复一次 (NSWeekCalendarUnit)。我的问题是,当本地时间更改(每年 2 次)时,通知将在 11:00 或 9:00 点触发。原因是NSWeekCalendarUnit是以秒为单位计算的(7天/周*24小时/天*60秒/小时)。即使本地时间已更改,我也希望闹钟仅在 10:00 触发。
有什么办法可以实现这一点吗?
最佳答案
您是否设置了UILocalNotification
的timeZone
属性?来自文档:
... 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.
关于iphone - 时间变化时重复 UILocalNotification 行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11668184/