More Related Content
More from Masayuki Nii (17)
Cocoa勉強会#55-EventKitでリマインダーの中身を探る
- 3. EventKit
Brand New on Mountain Lion
Developer Library
•
•
12年10月13日土曜日
Calendar and Reminders Programming Guide
LionまでのCalendarの情報はもしかしてすっかり消えている?
3
- 4. リマインダー
リマインダー or To Do List管理
•
•
みなさんはなにを使っていますか?
私は、スティッキーズ→Calendar→Bento→Remember the
Milk→リマインダー
Mountain Lionで新たに搭載されたアプリ
•
•
•
•
•
•
12年10月13日土曜日
iOSにも搭載されている
カレンダーの区分をそのまま利用
カレンダーの統合表示はない
時間は必ず時刻まで設定させられる
つまりは、微妙にTo Doではない
どうやら、Appleはこのジャンルに弱い模様
4
- 5. データベースからの取り出し
EKEventStoreクラスのインスタンスを得る
•
•
OS X: EKEventStore *store = [[EKEventStore alloc]
initWithAccessToEntityTypes:EKEntityMaskEvent];
iOS: [store requestAccessToEntityType:EKEntityTypeReminder
completion:^(BOOL granted, NSError *error) {
// handle access here
}];
全部取り出す
•
NSPredicate *predicate = [store predicateForRemindersInCalendars:nil];
[store fetchRemindersMatchingPredicate:predicate completion:^(NSArray
*reminders) {
for (EKReminder *reminder in reminders) {
// do something for each reminder
}
•
12年10月13日土曜日
}];
日付や完了日の範囲を指定して取り出しができる
5