2013-01-13 3 views
1

새로운 iOS 메소드 인 calendarItemWithIdentifier로 캘린더 이벤트를 조회하려고합니다. 이벤트가 서버와 동기화 된 후에 식별자가 변경되므로 eventWithIdentifier를 사용할 수 없습니다. calendarItemIdentifier가 아닙니다.calendarItemWithIdentifier를 사용하여 캘린더 이벤트 조회

그러나 calendarItemWithIdentifier는 항상 (null)을 반환합니다. 로그에서

EKEventStore *store = [[EKEventStore alloc] init]; 

[store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { 
    if (granted) { 

     // Create event. 
     EKEvent *event = [EKEvent eventWithEventStore:store]; 
     event.title = self.title; 
     event.startDate = [[NSDate date] dateByAddingTimeInterval:3600]; 
     event.endDate = [[NSDate date] dateByAddingTimeInterval:7200]; 
     event.timeZone = [NSTimeZone defaultTimeZone]; 
     event.calendar = [store defaultCalendarForNewEvents]; 

     BOOL success = [store saveEvent:event span:EKSpanThisEvent commit:YES error:&error]; 
     if (success) 
     { 
      NSString *calendarItemIdentifier = event.calendarItemIdentifier; 
      NSLog(@"Assigned identifier: %@", calendarItemIdentifier); 

      // Look up the event in the calendar. 
      event = (EKEvent *)[store calendarItemWithIdentifier:calendarItemIdentifier]; 
      if (event) { 
       NSLog(@"FOUND"); 
      } else { 
       NSLog(@"NOT FOUND"); 
      } 
     } 
    } 

}]; 

:

2013-01-13 10:32:52.042 CalendarIntegration[6095:1303] Assigned identifier: C5FD3792-EBF1-4766-B27D-2767E5C8F3BE 
2013-01-13 10:32:52.043 CalendarIntegration[6095:1303] NOT FOUND 

도움말을 감상 할 수있다. 다큐먼트 따르면

+0

동일한 문제 :( –

답변

0

이 문제는 일정

전체 동기화는이 식별자를 잃는 것, link을 예상한다. 다른 속성을 캐싱하여 식별자를 더 이상 가져올 수없는 달력을 처리 할 계획이 있어야합니다.