Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未添加到Iphone 5默认日历中的事件_Iphone_Ios - Fatal编程技术网

未添加到Iphone 5默认日历中的事件

未添加到Iphone 5默认日历中的事件,iphone,ios,Iphone,Ios,在我的应用程序中,我必须将事件添加到Iphone默认日历中 EKEventStore *eventStore = [[EKEventStore alloc] init]; EKEvent *event1 = [EKEvent eventWithEventStore:eventStore]; event1.notes=descriptionStr; event1.startDate =edate; event1.endDate=fdate; [event1 setTimeZone:[NSTim

在我的应用程序中,我必须将事件添加到Iphone默认日历中

EKEventStore *eventStore = [[EKEventStore alloc] init]; 
EKEvent *event1  = [EKEvent eventWithEventStore:eventStore];
event1.notes=descriptionStr;
event1.startDate =edate;
event1.endDate=fdate;
[event1 setTimeZone:[NSTimeZone systemTimeZone]];
[event1 setCalendar:[eventStore defaultCalendarForNewEvents]];

问题在于Iphone5。对于4S和以前的版本,该活动添加得非常完美。请指导我。谢谢。

根据EKEventStoreClassRef的苹果文档:

在iOS 5及更高版本上,使用默认的init方法初始化事件存储对象。在iOS 6及更高版本上,必须在使用requestAccessToEntityType:completion:初始化事件存储后请求访问实体类型,才能返回数据


在安装了iOS 6的情况下,它可以在4S上运行吗?

是否检查是否可以访问日历:不,我没有检查,它可以在4S上运行,我必须使应用程序与iOS 6兼容。你能更详细地解释一下吗@rckoenes阅读上面链接中的苹果文档,我还没有在iOS 6中使用EventKit。作为回应,iOS 6中的事件是为4S添加的,而不是为Iphone 5添加的。我以前从未处理过ekevents,你能详细解释一下plz@Lammert这是苹果公司关于这个话题的一个很好的指南: