2012-11-20 30 views
1

我正在嘗試將Kal日曆應用到我自己的項目中。我已經下載了一個github項目的副本並在模擬器上運行它。一切工作正常,並顯示來自模擬器日曆的數據。Kal日曆在模擬器中抓取日曆中的數據但不在設備上

但是,當我在真實的設備上測試它。它不提取數據,它給我以下錯誤。

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

任何人都可以幫助我嗎?

親切的問候和提前致謝

回答