【问题标题】:Kal calendar fetching data from calendar in simulator but not on deviceKal日历从模拟器中的日历中获取数据,但不在设备上
【发布时间】:2012-11-20 09:30:54
【问题描述】:

我正在尝试将 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.)"

这就是我获取的样子。

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

谁能帮帮我?

提前致以诚挚的问候和感谢

【问题讨论】:

    标签: objective-c ios github calendar ios-simulator


    【解决方案1】:

    好的,所以它与用户权限有关。我在这里找到了答案。

    How to get the name/id of default calendar in iOS 6

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-04
      • 1970-01-01
      相关资源
      最近更新 更多