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

前端 未结 4 1006
梦谈多话
梦谈多话 2021-01-13 03:51

I have an app that programmatically adds reminders to your iOS device\'s calendar.

Previous to iOS 5, I could add a calendar item with two alarms thusly:

<         


        
相关标签:
4条回答
  • 2021-01-13 04:10

    I had the same error.

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

    0 讨论(0)
  • 2021-01-13 04:12

    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.

    0 讨论(0)
  • 2021-01-13 04:18

    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];
    
    0 讨论(0)
  • 2021-01-13 04:22

    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 .

    0 讨论(0)
提交回复
热议问题