if ([eventStore.calendars count] == 0)
{
NSLog(@"No calendars are found.");
return NO;
}
EKCalendar *targetCalendar = nil;
/* Try to find the calendar that the user asked for */
for (EKCalendar *thisCalendar in eventStore.calendars){ line2
if ([thisCalendar.title isEqualToString:paramCalendarTitle] &&
thisCalendar.type == paramCalendarType){
targetCalendar = thisCalendar;
break;
}
}
第一行和第二行出现错误:"calendars deprecated : first deprecated in IOS 6"
如何解决?