我想從用戶請求上的日曆中刪除事件。這是我想出的:從iPhone的日曆中刪除事件
// Deleting Event
EKEventStore *eventStore = [[EKEventStore alloc] init];
EKEvent *event = [EKEvent eventWithEventStore:eventStore];
event.title = appDelegate.title1;
event.startDate = appDelegate.recAddDate;
event.endDate = appDelegate.currentDateName;
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore removeEvent:event span:EKSpanThisEvent error:&err];
以下是我打電話從事件數組中刪除事件的函數。項目陣列用於從iPhone日曆
- (BOOL)removeEvent:(EKEvent *)event span:(EKSpan)span error:(NSError **)error{
VoiceRecorderAppDelegate *appDelegate = (VoiceRecorderAppDelegate *)[[UIApplication sharedApplication] delegate];
[items removeObjectAtIndex:appDelegate.objectindexpath];
}
你能解決這個問題嗎? – 2011-07-28 13:33:24
http://stackoverflow.com/questions/3482920/removing-events-from-iphone-calendar-with-ekeventstore – iGo 2011-08-01 13:30:50
有兩個重複的答案! – Maulik 2011-12-30 12:34:36