2

コードは次のとおりです。

 EKEventStore *store = [[EKEventStore alloc]
                       initWithAccessToEntityTypes:EKEntityMaskEvent];
NSArray *eventCalendars = [store calendarsForEntityType:EKEntityTypeEvent];

NSDate *monday, *sunday;
NSPredicate *predicate;
predicate = [store predicateForEventsWithStartDate:monday
                                           endDate:sunday
                                         calendars:eventCalendars];
NSArray *events = [store eventsMatchingPredicate:predicate];
NSLog(@"Events this week:");
for (EKEvent *event in events) {
    NSLog(@"%@ - starts at %@", event.title, event.startDate);
}

「宣言されていない識別子'EKEntityMaskEvent'の使用」および宣言されていない識別子'EKEntityTypeEvent'の使用というエラーが発生します

これを修正するにはどうすればよいですか?

4

2 に答える 2

0

http://developer.apple.com/library/mac/#documentation/EventKit/Reference/EKEventStoreClassRef/Reference/Reference.html#//apple_ref/doc/uid/TP40009567から

initWithAccessToEntityTypes:OSXv10.8以降で使用できます。

于 2012-09-03T08:02:57.727 に答える
0

まだ公開されていないiOSSDKの将来のバージョンを使用している可能性があります。これを機能させるには、新しいSDKをサポートする未リリースバージョンのXcodeを使用する必要があります。(多分それはあなたが使う必要があるXcode4.5ですか?)

今後リリースされていないSDKについて質問がある場合は、AppleDeveloperForumに投稿してください。

于 2012-09-03T08:10:16.283 に答える