EventKit - App freezes when adding an EKEvent with 2 alarms (iOS 5)

不想你离开。 提交于 2019-12-01 05:53:23
Louie

Its a bug with Apple. If you set 2 alarms it causes the app to freeze. If you only set 1 it works just fine. This is fixed in iOS 5.1 .

If you take a look at the EventKit section in the iOS 5 changes from iOS 4.3 document, it mentions that some items are deprecated for EKEvent. The hierarchy has changed and a new abstract superclass has been added: EKCalendarItem.

Jimmy

have you tried calling addAlarm using a variable?

EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:60.0f * -5.0f]]; // 5 min
[event addAlarm:alarm];

EKAlarm *alarm2 = [EKAlarm alarmWithRelativeOffset:60.0f * -15.0f]]; // 15 min
[event addAlarm:alarm2];

I had the same error.

The problem seems that startDate shoudln't be the same as endDate... really silly iOS change!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!