我以编程方式将事件添加到日历中,但现在我想从日历中删除它,因此创建事件ID&用它来从日历中删除事件,但它不起作用,请帮帮我..这里是我用来删除事件的代码,请帮帮我
EKEventStore *eventstore = [[EKEventStore alloc]init];
[eventstore requestAccessToEntityType:EKEntityTypeEvent completion:
^(BOOL granted, NSError *error)
{
if (!granted)
{
return ;
}
//addEventGranted = 1;
EKEvent* eventToRemove = [eventstore eventWithIdentifier:self.savedEventId];
if (eventToRemove)
{
NSError* error = nil;
[eventstore removeEvent:eventToRemove span:EKSpanThisEvent commit:YES error:&error];
}
}];}