简体   繁体   English

谓词调用日历守护程序失败:错误域= EKCADErrorDomain代码= 1013

[英]Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013

Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn't be completed. (EKCADErrorDomain error 1013.)" 对日历守护程序的谓词调用失败:错误域= EKCADErrorDomain代码= 1013“操作无法完成。(EKCADErrorDomain错误1013。)

I am trying to fetch reminders from default app. 我正在尝试从默认应用中获取提醒。

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.
            }
        }];
    }

---- Fetching the reminder for the date----- -获取日期提醒-

-(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];
    }];
}

I am getting this error:- Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn't be completed. (EKCADErrorDomain error 1013.)" 我收到此错误:-对日历守护程序的谓词调用失败:错误域= EKCADErrorDomain代码= 1013“操作无法完成。(EKCADErrorDomain错误1013。)

Please help. 请帮忙。

The warning is because the user didn't give the permission for accessing the reminder. 该警告是因为用户未授予访问提醒的权限。

Quick Fix: 快速解决:

  1. Goto Settings 前往设置
  2. Select Privacy 选择隐私
  3. Select Reminders 选择提醒
  4. Choose your application and allow access of "Reminders" to ON. 选择您的应用程序,并允许将“提醒”访问为ON。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谓词调用日历守护程序失败:错误域= EKCADErrorDomain代码= 1013 Calendar Swift - Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013 Calendar Swift EKCADErrorDomain代码= 1013 - EKCADErrorDomain Code=1013 获取所有日历时出错:错误域= EKCADErrorDomain代码= 1013“(null)”Swift 3 - Error getting all calendars: Error Domain=EKCADErrorDomain Code=1013 “(null)” Swift 3 EKEventStore eventWithIdentifier导致EKCADErrorDomain错误1010 - EKEventStore eventWithIdentifier causes EKCADErrorDomain error 1010 加载失败,错误为 Error Domain=NSURLErrorDomain Code=-999“已取消” - load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" “ PBRequester失败,错误域= NSURLErrorDomain代码= -1000错误的URL” - “PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1000 ”bad URL" 无法获取具有错误的远程视图控制器:错误:domain = _UIViewServiceInterfaceErrorDomain,code = 2 - Failed to get remote view controller with error: Error: domain=_UIViewServiceInterfaceErrorDomain, code=2 Fabric 无法下载设置 Error Domain=FABNetworkError Code=-5 - Fabric failed to download settings Error Domain=FABNetworkError Code=-5 AFHTTPRequestOperationManager获取请求失败,错误域= AFNetworkingErrorDomain代码= -1016 - AFHTTPRequestOperationManager Get request failed,Error Domain=AFNetworkingErrorDomain Code=-1016 Fabric无法下载设置Error Domain = FABNetworkError Code = -6 - Fabric failed to download settings Error Domain=FABNetworkError Code=-6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM