Tag: ekeventkit

EKEventEditViewController会冻结应用程序并在很长时间后加载

我在swift中有以下代码: var eventController = EKEventEditViewController() eventController.editViewDelegate = self var store = EKEventStore() eventController.eventStore = store var event = EKEvent(eventStore: store) event.title = viewModel.roleName event.location = viewModel.location event.startDate = viewModel.startDate event.endDate = viewModel.endDate eventController.event = event var status = EKEventStore.authorizationStatusForEntityType(EKEntityTypeEvent) switch status { case .Authorized: self.setNavBarAppearanceStandard() dispatch_async(dispatch_get_main_queue(), { () -> Void in self.presentViewController(eventController, animated: true, completion: […]

本地日历在iOS 10.2.1中消失

我有一个应用程序,我正在创build一个本地日历,以添加应用程序中显示的事件。检查事件types,然后添加事件的代码是标准的,如下所示: if([eventStore respondsToSelector:@selector(sources)]) { for (EKSource* source in eventStore.sources) { if (source.sourceType == EKSourceTypeBirthdays){ localSource = EKSourceTypeLocal; break; } } 在iOS 10.1中,打印事件源显示设备中存在的所有日历以及应用中存在的本地日历,如下所示: EKSource <0x1700c6e40> {UUID = 6B5927E7-78D6-418B-82D3-C06821A51758; type = Local; title = Default; externalID = (null)}, EKSource <0x1700c6740> {UUID = DE256E79-E778-44EA-99F9-0C28374F043C; type = Other; title = Other; externalID = (null)}, EKSource <0x1700c6190> {UUID = 9F735DC3-43D5-4F94-84D5-76AF832B3CB3; […]

当用户点击特定的date时,将会显示一个提醒标题

我正在使用SAcalendar。 这是我的JSON: data: – [ – { id: "1", event_start: "2014-06-09 11:30", event_end: "2014-06-09 12:30", title: "Click a date to create a new event and drag to change its date and time. Click on an existing event to modify. Click "Show Standard Settings" to set additional event properties." }, – { id: "2", event_start: "2017-01-03 […]

在iPhone中使用Event Kit删除事件

我在iOS应用程序中使用Event Kit,并使用Event Kit创build事件。 我能够创build它,但我想给予删除的能力。 但我无法做到这一点。 我知道有一个EKEventStore删除事件的方法,但我不能使事件对象。 我有事件标识符作为一个string,但我不能创build一个事件对象使用它。 有人可以指导我做吗? 关于Pankaj

saveEvent返回“没有设置日历”

我试图从我的应用程序中将事件保存到日历中。 我的代码适用于iOS 7,但在iOS 6上 ,它返回没有设置日历。 应用程序会提示用户在iOS 7上授予对日历的访问权限。但iOS 6不会显示此类提示。虽然应用程序已被授予“ 设置” – >“隐私” – >“日历”的访问权限。 是的,我已经实现了requestAccessToEntityType:completion: 。 这是我的代码片段 。 EKEventStore *objStore = [[EKEventStore alloc]init]; if ([objStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]) { // iOS 6 and later [objStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ if (granted) { // code here for when the user allows your app to access […]

EKEventStore获取事件返回空列表

我想从我的应用程序中的特定日历中获取所有事件。 我在我的应用程序中创build了日历和testing事件(需要iOS 5.0或更高版本才能创build自定义日历)。 如果我在我的设备上运行应用程序,然后检查系统日历应用程序,然后我的日历和我创build的事件显示正确。 现在我想让我的应用程序读取这个自定义日历中的所有事件。 我的事件创build与startDate和endDate设置为NOW(NSDate alloced给没有timeInterval)。 NSDate *startDate = [NSDate dateWithTimeIntervalSinceNow:- 60 * 60 * 24 * (365 * 4 + 1)]; NSDate *endDate = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24 * 365 * 25]; NSArray *calendarList = [NSArray arrayWithObjects:tmpCal, nil]; NSPredicate *datePredicate = [store predicateForEventsWithStartDate:startDate endDate:endDate calendars:calendarList]; NSArray *eventList = [store eventsMatchingPredicate:datePredicate]; 正如你所看到的,我正在指定一个时间间隔,在这个时间间隔中,结果事件必须是。 […]

如何使用eventKit框架为特定date设置提醒(警报)

我正在iOS 5中使用EventKit框架,并使用下面的代码成功地将事件添加到iOS日历 EKEventStore *eventDB = [[EKEventStore alloc] init]; EKEvent *myEvent = [EKEvent eventWithEventStore:eventDB]; myEvent.title = @"New Event"; myEvent.startDate = [[NSDate alloc] init]; myEvent.endDate = [[NSDate alloc] init]; myEvent.allDay = YES; [myEvent setCalendar:[eventDB defaultCalendarForNewEvents]]; 现在我该如何为这个事件添加警报(提醒)? 感谢Ranjit

如何检测哪个EKevent发生了变化

我得到了这个问题。 我需要知道在EventStore中的事件发生了什么变化,所以在这种情况下,我使用EKEventStoreChangedNotification但是这个通知返回给我在userInfo的不可理解的字典它看起来像这样: EKEventStoreChangedObjectIDsUserInfoKey = ("x-apple-eventkit:///Event/p429" ); 我不知道如何使用这些数据访问更改的对象。 请帮帮我

将参与者添加到iOS中的事件

在EKParticipant Class参考中,“将参与者发送到EKEvent对象以获取EKParticipant对象的数组”。好的,请购买如何将参与者发送到EKEvent对象? 有人给的例子代码?