目标是通过Apple 的文档创建提醒事件。到目前为止,我已经创建了实例变量(并且也在头文件中实现了)。
- (EKReminder *)reminderWithEventStore:(EKEventStore *)eventStore {
EKEvent *event = [EKEvent eventWithEventStore:eventStore];
event.title = webTitle;
event.notes = urlField.text;
event.startDate = [[NSDate alloc] init];
event.endDate = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate];
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore saveEvent:event span:EKSpanThisEvent error:&err];
}
如何通过单击 UIActionSheet 中的按钮时执行代码来创建提醒?我已经尝试过[self.eventStore:self];
了,但我猜想还有更多。