14.2. Dodawanie wydarzeń do kalendarzy

Problem

Chcesz uzyskać możliwość tworzenia nowych wydarzeń w kalendarzach użytkownika.

Rozwiązanie

Najpierw odszukaj kalendarz, w którym chcesz umieścić nowe wydarzenie (zobacz „14.1. Pobieranie listy kalendarzy”). Za pomocą metody klasy o nazwie eventWithEventStore: klasy EKEvent utwórz nowy obiekt typu EKEvent, a następnie zapisz go w kalendarzu użytkownika, używając metody egzemplarza o nazwie saveEvent:span:error: klasy EKEventStore.

- (BOOL)createEventWithTitle:(NSString *)paramTitle startDate:(NSDate *)paramStartDate endDate:(NSDate *)paramEndDate inCalendarWithTitle:(NSString *)paramCalendarTitle inCalendarWithType:(EKCalendarType)paramCalendarType notes:(NSString *)paramNotes { BOOL result = NO; EKEventStore ...

Get iOS 5. Programowanie. Receptury now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.