我尝试使用EKEventStore检查网页中的文档和引用。但仍然得到下面的问题,似乎我不能访问商店在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-Test011520132296:403默认日历:(Null) is nil:(null) 2013-02-02 08:24:42.429 iCalendarProfiler-Test011520132296:403总日历0
发布于 2013-11-06 15:04:18
适用于OS X的EKEventStore自10.8起可用,不适用于OS X 10.7.5
https://stackoverflow.com/questions/14657731
复制相似问题