#import <EventKit/EventKit.h>
我无法在默认iOS日历中创建活动。无法在默认iOS 7日历中创建活动
EKEventStore *eventStore = [[EKEventStore alloc] init];
for (EKSource *source in eventStore.sources)
{
if (source.sourceType == EKSourceTypeCalDAV || source.sourceType == EKSourceTypeLocal)
{
NSLog(@"I found it");
break;
}
}
从这里开始它不能返回任何来源。当我构建并运行应用程序时,没有任何请求可以访问默认日历。
所有的一切我得到一个空数组:
[eventStore.sources count]
即使我想,而无需创建新的日历添加事件(使用
[eventStore defaultCalendarForNewEvents]
你有事件许可吗? –