14.8. Obsługa powiadomień informujących o zmianie wydarzenia

Problem

W aplikacji chcesz otrzymać powiadomienie, gdy użytkownik wprowadzi jakiekolwiek zmiany w bazie danych aplikacji Kalendarz.

Rozwiązanie

Zarejestruj otrzymywanie powiadomień EKEventStoreChangedNotification.

- (EKCalendar *)calDAVCalendarWithTitleContaining:(NSString *)paramDescription inEventStore:(EKEventStore *)paramEventStore { EKCalendar *result = nil; for (EKCalendar *thisCalendar in paramEventStore.calendars) { if (thisCalendar.type == EKCalendarTypeCalDAV) { if ([thisCalendar.title rangeOfString:paramDescription].location != NSNotFound) { return thisCalendar; } } } return result; } - (void)eventsChanged:(NSNotification *)paramNotification { NSMutableArray *invalidatedEvents ...

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.