我正在构建一个应用程序,其中包含了一些iOS日历功能。用户可以创建事件并将其发送到iCal,但我只希望应用程序中创建的事件显示在应用程序的日历上。
我知道我可以使用如下谓词:
NSPredicate *predicate = [_eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:preferredAppleCalendars];
NSArray *appleEventsArray = [_eventStore eventsMatchingPredicate:predicate];但是我也有一个eventIdentifiers数组,我想将其作为一个条件添加。因此,我希望事件存储区的事件如上,但只有在事件与我的数组中的事件标识符匹配时。这有可能吗?
发布于 2015-10-18 00:03:28
与其使用eventsMatchingPredicate将所有事件实际提取到数组中,不如调用enumerateEventsMatchingPredicate。这允许你进一步过滤掉结果,只保留你喜欢的结果。记得先进入后台线程!
https://stackoverflow.com/questions/33192522
复制相似问题