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

前端 未结 4 1005
梦谈多话
梦谈多话 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: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];
    

提交回复
热议问题