我正在尝试将Kal日历应用到我自己的项目中。我已经下载了github项目的副本并在模拟器上运行它。一切正常,并显示模拟器日历中的数据。
但是当我在真实设备上测试时。它没有获取数据,它给我以下错误。
CalendarApp[1024:1103] Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"
这就是我的fetch的样子。
- (void)presentingDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate delegate:(id<KalDataSourceCallbacks>)delegate
{
// asynchronous callback on the main thread
[events removeAllObjects];
NSLog(@"Fetching events from EventKit between %@ and %@ on a GCD-managed background thread...", fromDate, toDate);
dispatch_async(eventStoreQueue, ^{
NSDate *fetchProfilerStart = [NSDate date];
NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:fromDate endDate:toDate calendars:nil];
NSArray *matchedEvents = [eventStore eventsMatchingPredicate:predicate];
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"Fetched %d events in %f seconds", [matchedEvents count], -1.f * [fetchProfilerStart timeIntervalSinceNow]);
[events addObjectsFromArray:matchedEvents];
[delegate loadedDataSource:self];
});
有人能帮助我吗?
亲切的问候和提前谢谢