- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对日历守护程序的谓词调用失败:错误域=EKCADErrorDomain 代码=1013“操作无法完成。(EKCADErrorDomain 错误 1013。)”
我正在尝试从默认应用中获取提醒。
if([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]) {
// need user permission for iOS 6 and later
[eventStore requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) {
if (granted) {
//---- codes here when user allow your app to access theirs' calendar.
[self performCalendarActivity:eventStore];
}
else {
//----- codes here when user NOT allow your app to access the calendar.
}
}];
}
----获取日期的提醒------
-(void)performCalendarActivity:(EKEventStore*)evtStore
{
self.eventsList = [[NSMutableArray alloc] initWithArray:0];
int seconds_in_day = 60*60*24;// 1 day = 60*60*24 seconds = 86400 seconds
NSDate *endDate = [startDate dateByAddingTimeInterval:seconds_in_day];
// use Dictionary for remove duplicates produced by events covered more one year segment
NSMutableDictionary *eventsDict = [NSMutableDictionary dictionaryWithCapacity:1024];
NSDate* currentStart = [NSDate dateWithTimeInterval:0 sinceDate:startDate];
NSDate* currentFinish = [NSDate dateWithTimeInterval:seconds_in_day sinceDate:currentStart];
if ([currentFinish compare:endDate] == NSOrderedDescending) {
currentFinish = [NSDate dateWithTimeInterval:0 sinceDate:endDate];
}
NSMutableArray *events = [NSMutableArray arrayWithObjects: nil];
NSArray *calendars = [eventStore
calendarsForEntityType:EKEntityTypeReminder];
NSPredicate *predicate = [eventStore predicateForRemindersInCalendars:calendars];
//NSPredicate *predicate = [eventStore predicateForIncompleteRemindersWithDueDateStarting:startDate ending:currentFinish calendars:calendars];
[eventStore fetchRemindersMatchingPredicate:predicate completion:^(NSArray *ekReminders){
[events addObjectsFromArray:ekReminders];
}];
}
我收到这个错误:- 对日历守护程序的谓词调用失败:错误域=EKCADErrorDomain 代码=1013“操作无法完成。(EKCADErrorDomain 错误 1013。)”
请帮忙。
最佳答案
警告是因为用户没有授予访问提醒的权限。
快速修复:
关于ios - 对日历守护程序的谓词调用失败 : Error Domain=EKCADErrorDomain Code=1013,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17994127/
这个问题在这里已经有了答案: defaultCalendarForNewEvents failed (8 个答案) 关闭 7 年前。 EKReminder *reminder = [EKRemind
在我的 iOS 应用程序中,我曾经使用以下方法访问日历: EKCalendar* cal = [eventStore calendarWithIdentifier:[calendarIDs objec
创建日历事件对我来说效果很好,编辑已经存在的事件会导致问题。当我尝试将 eventWithIdentifier 用于 EKEventStore 对象的实例时,它会注销他的错误: 获取标识符为 5E5E
对日历守护程序的谓词调用失败:错误域=EKCADErrorDomain 代码=1013“操作无法完成。(EKCADErrorDomain 错误 1013。)” 我正在尝试从默认应用中获取提醒。 if(
我有一个使用日历的应用程序。 该项目直到今天都运行良好。我试图在同一台设备上运行应用程序,但出现错误: Predicate call to calendar daemon failed: Error
我有一个应用程序可以将日历列表加载到选择器 View 中。它可以工作,但只有在应用程序崩溃并再次打开后才能工作。我不确定为什么它在应用程序的初始打开时不起作用。 日历权限请求: func reques
我是一名优秀的程序员,十分优秀!