1

[固定](有点)似乎你不能在事件结束时发出警报。我希望该事件在日历中出现 x 天,然后在它到期时发出警报以发出信号。似乎这是不可能的。只能在活动开始前发出警报。傻苹果:(

添加新事件时,我似乎无法保存警报。这是代码......我希望警报在事件发生时响起,我想也许全天选项会搞砸它,但无论如何它都不会保存。

这是代码...

EKEventStore *store = [[EKEventStore alloc] init];
EKEvent *event = [EKEvent eventWithEventStore:store];

event.title = title;
event.startDate = [global main].Entry.WithdrawalDate;
event.endDate = [global main].Entry.WithdrawalDate;
//event.allDay = YES;
event.availability = EKEventAvailabilityFree;
event.location = [global main].Holding.Name;
event.notes = [self compileNotes];

//Tried settings the array and adding to it, neither works
//NSArray *arrAlarm = [NSArray arrayWithObject:[EKAlarm alarmWithAbsoluteDate:[global main].Entry.WithdrawalDate]];
//event.alarms= arrAlarm;
EKAlarm * alarm = [EKAlarm alarmWithAbsoluteDate:[global main].Entry.WithdrawalDate];
[event addAlarm:alarm];


[event setCalendar:[store defaultCalendarForNewEvents]];
NSError *err;
saved = [store saveEvent:event span:EKSpanThisEvent commit:YES error:&err];
4

0 回答 0