0

我正在尝试在日历上保存一些事件,但我显然无法获得非零事件。当然,我在库和文件的包含中都包含了 EventKit,并且传递的 EventStore 不是零。可能是什么?

谢谢,法布里齐奥

那是相关的代码:

myEventStore =[[EKEventStore alloc] init];
self.eventStoreAccessGranted = NO;
[myEventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
    self.eventStoreAccessGranted = granted;
    if (!granted) {
        NSLog(@"User has not granted permission");
    } else NSLog(@"User has granted permission");
}];

if (self.eventStoreAccessGranted){
    NSLog(@"enter calendar");
    EKEvent *evento = [EKEvent eventWithEventStore:myEventStore];
    if (evento==nil) return;
....
}
4

0 回答 0