EKEventStore *eventDB = [[EKEventStore alloc] init];
EKEvent *myEvent = [EKEvent eventWithEventStore:eventDB];
NSString *trimmedString = [[arrDateList objectAtIndex:i] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
myEvent.title = [d valueForKey:@"garden_name"];
myEvent.startDate = [dateFormatter dateFromString:trimmedString];
myEvent.endDate = [dateFormatter dateFromString:trimmedString];
myEvent.allDay = TRUE;
[myEvent setCalendar:[eventDB defaultCalendarForNewEvents]];
NSError *err;
[eventDB saveEvent:myEvent span:EKSpanThisEvent error:&err];
我正在使用上面的代码行,但我无法将事件存储在日历中......请帮助我在代码行中有错误的地方......谢谢并问候 Rahul Virja