Tag: 包ekevent

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: […]

EKCalendar中的过去事件

我试图从一个确定的EKCalendar获取所有的事件,但是如果我调用eventsMatching Predicate:用predicateForEventsWithStartDate生成一个predicateForEventsWithStartDate:endDate:calendars:和一个过去的' startDate '我得到一个空对象。 这是一个错误? 或者我无法回顾过去的事情? 编辑(NSData的declarations): [[self eventStore] predicateForEventsWithStartDate:[NSDate distantPast] endDate:[NSDate distantFuture] calendars:syncedCalendars]

在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]; 正如你所看到的,我正在指定一个时间间隔,在这个时间间隔中,结果事件必须是。 […]

我怎样才能在EKRecurrenceRule中设置一周的数组?

我想在用户select的特定date每周添加活动。 它可以是一个或多个,也可以是一整天。 我在模型类variables中存储用户select的date值。 但是,当我添加事件,并select今天假设今天是星期一,我select星期二和星期三,并保存它。 然后我检查它在周一和周三添加的iPhone日历。 我不能理解这个问题,即使我debugging我的代码,我为模型类variables的一天select得到正确的价值,那么为什么结果不同? build议我任何解决scheme或想法。 谢谢 var days = [EKRecurrenceDayOfWeek]() if routineData.routine_monday == 1 { days = [EKRecurrenceDayOfWeek(.monday)] } if routineData.routine_tuesday == 1 { days = [EKRecurrenceDayOfWeek(.tuesday)] } if routineData.routine_wednesday == 1 { days = [EKRecurrenceDayOfWeek(.wednesday)] } if routineData.routine_thursday == 1 { days = [EKRecurrenceDayOfWeek(.thursday)] } if routineData.routine_friday == 1 { days = […]

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

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

用EKEvent在iPhone中播放闹钟

我正在使用EKEvent类存储事件的应用程序,我希望我的应用程序在发生事件时触发警报。 我不知道如何在iPhone上播放闹钟。

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

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

修改EKParticipants(参加者)在EventKit像日出

我的目标是将一些被邀请者添加到EKEvent 。 我已经研究过这样的其他问题,比如这个问题 ,但是都表示,以编程方式将EKParticipant添加到EKParticipant本质上是不可能的。 我确实看到attendees属性是只读的,但是我看到其他服务,如Sunrise在移动应用程序中使用它。 我相信他们正在使用一些至less部分与EventKit集成的系统,因为他们从用户的iCal应用程序中获取日历。 例如,从添加的Exchange帐户发送的邀请也由Exchange服务明确发送,而不是由Sunrise自己的邀请(将事件直接发送到Exchange或将其发布到iCal)。 任何解决方法这个限制将是非常有益的 – 也许可以调用添加/删除被邀请者的Exchange端点? EventKit内的解决方法? 只要它不是一个私人的苹果API,我会高兴地尝试一下。 谢谢!