在我的日历iOS:Obj-C中有我活动的结束时间

在我的日历iOS:Obj-C中有我活动的结束时间,ios,iphone,xcode,events,ekeventstore,Ios,Iphone,Xcode,Events,Ekeventstore,我想有实际的事件,这是在我的日历应用程序同步 实际事件就是现在正在发生的事件 首先,我想制作一个应用程序,告诉我离活动结束还有多少时间。 该活动是我与iphone同步的日历 在Main.StoryBoard中,我声明了一个标签: @property (strong, nonatomic) IBOutlet UILabel *currentEvent; 我声明了一个EKEventStore: EKEventStore *store = [[EKEventStore alloc] init];

我想有实际的事件,这是在我的日历应用程序同步

实际事件就是现在正在发生的事件

首先,我想制作一个应用程序,告诉我离活动结束还有多少时间。 该活动是我与iphone同步的日历

在Main.StoryBoard中,我声明了一个标签:

@property (strong, nonatomic) IBOutlet UILabel *currentEvent;
我声明了一个EKEventStore:

EKEventStore *store = [[EKEventStore alloc] init];
从现在起,我知道如何创建一个事件,包括开始日期、结束日期。。但是我想从我当前的事件中检索信息,以便能够做到:endDate-timeActual

接下来,在我的标签中,它将被写为:活动结束前57分钟

NSLog(@"%i minutes before the end of the event.", remainTime );
我不知道我是否清楚,如果你不明白我在问什么,请告诉我?
谢谢你的帮助!:)

[更新]

我知道如何使用日历的标识符:

EKEventStore *store = [[EKEventStore alloc] init];
store = [[EKEventStore alloc] init];

 [store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
                                if (!granted)
                                    NSLog(@"Access to store not granted");
                            }];
     NSArray *calendars = [store calendarsForEntityType:EKEntityTypeEvent];

  for (EKCalendar *calendar in calendars)
{
    NSLog(@"Calendar = %@", calendar.description);  
    self.currentEvent.text = [NSString stringWithFormat:@"%@", calendar.calendarIdentifier];
}

EKCalendar *myCalendar = calendars[0];
NSLog(@"My Calendar = %@", myCalendar);

EKEvent *actualEvent = [EKEvent eventWithEventStore:store];
我知道如何在我的日历上设置事件,但我的日历中没有任何事件


你有什么想法吗?

请为你的问题提供更多的背景;)i、 e.你的总体目标是什么(这是客户想要支付的)?你试过什么?你想发生什么?你期待什么?到底发生了什么?你说“我想恢复实际事件”;我不明白你所说的“实际事件”是什么意思。在这种情况下,我不明白你所说的“恢复”是什么意思。事件是否已被销毁?