2013-02-02 17 views
1

我嘗試使用EKEventStore檢查Web和參考中的文檔。但是仍然遇到了像OSx中無法訪問商店的問題。我的是10.7.5,請幫助建議我在這方面做了什麼錯誤。無法訪問OSx中的EKEventStore

#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); 
} 

這是在登錄

出來

2013年2月2日08結果:24:42.429 iCalendarProfiler-Test01152013 [2296:403]默認日曆:(空)是零:(空) 2013年2月2日08:24:42.429 iCalendarProfiler-Test01152013 [2296:403]共有日曆0

回答

0

EKEventStore爲OS X是可用的,因爲10.8,不適用於OS X 10.7.5