【问题标题】:Can not access EKEventStore in OSx无法在 OSx 中访问 EKEventStore
【发布时间】:2013-02-02 01:38:00
【问题描述】:

我尝试使用 EKEventStore 来检查 Web 中的文档和参考。但仍然遇到以下问题,似乎我无法访问 OSx 中的商店。我的是 10.7.5,请帮忙指出我在这方面做错了什么。

#import "AppDelegate.h" 
@implementation AppDelegate
@synthesize store = _store;
@synthesize defaultCalendar = _defaultCalendar;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    self.store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityTypeEvent];
    self.defaultCalendar  = [self.store defaultCalendarForNewEvents];
}

- (IBAction)startPress:(id)sender {
    NSLog(@"Default calendar:%@ is nil:%@", [self.defaultCalendar title],(self.defaultCalendar));
    NSArray *calendars = [self.store calendarsForEntityType:EKEntityTypeEvent];
    NSLog(@"Total calendars %lu", calendars.count);
}

这是Log出来的结果

2013-02-02 08:24:42.429 iCalendarProfiler-Test01152013[2296:403] 默认日历:(null) 为 nil:(null) 2013-02-02 08:24:42.429 iCalendarProfiler-Test01152013[2296:403] 日历总数 0

【问题讨论】:

    标签: osx-lion ekeventstore


    【解决方案1】:

    用于 OS X 的 EKEventStore 从 10.8 开始可用,不适用于 OS X 10.7.5

    【讨论】:

      猜你喜欢
      • 2013-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      相关资源
      最近更新 更多