1

谁能告诉我如何为 iOS 日历事件制作一个重复的(每周、每天、每月)事件。我目前的实现是这样的:

EKEvent *event = [EKEvent eventWithEventStore:eventStore];

event.title = [cellValue objectForKey:@"ZEVENTNAME"];
event.notes = [cellValue objectForKey:@"ZEVENTDESCRIPTION"];
event.location = [cellValue objectForKey:@"ZLOCAITONname"];

NSString * dateStart  =[cellValue objectForKey:@"ZEVENTSTARTDATE"];
NSString * dateEnd =[cellValue objectForKey:@"ZEVENTENDDATE"];

NSDateFormatter *_formatter=[[NSDateFormatter alloc]init];
[_formatter setDateFormat:@"yyyyMMdd"];

NSDate *sDate = [_formatter dateFromString:dateStart];
NSDate *eDate = [_formatter dateFromString:dateEnd];
[_formatter setDateFormat:@"MM/dd/yyyy"];

event.startDate = sDate;
event.endDate = eDate;


event.calendar = [eventStore defaultCalendarForNewEvents];

NSError *error;
[eventStore saveEvent:event span:EKSpanThisEvent error:&error];

我已经通过苹果的开发人员帮助,但无法获得如何实现的方式。

谢谢

4

0 回答 0