我编写了以下代码片段来创建一个事件.设置闹钟在 iOS 4 中工作正常,但在 iOS 5 中没有设置.这是一个错误还是我错过了什么?
I wrote the following snippet to create an event. Setting the alarm works fine in iOS 4, but in iOS 5 it doesn't get set. Is this a bug or am I missing something?
EKCalendar *cal = [self.eventStore defaultCalendarForNewEvents];
EKEvent *event = [EKEvent eventWithEventStore:self.eventStore];
event.calendar = cal;
// .......
EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:-3600];
event.alarms = [NSArray arrayWithObject:alarm];
// .......
我遇到了同样的错误.
问题似乎是 startDate 不应该与 endDate 相同......真是愚蠢的 iOS 变化!
The problem seems that startDate shoudln't be the same as endDate... really silly iOS change!
这篇关于EKAlarm 不会在 iOS 5 中设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!