我熟悉使用 eventstore
搜索谓词,例如 predicateForIncompleteRemindersWithDueDateStarting:Ending:Calendars:
但我正在尝试找出如何搜索任何未设置任何截止日期的不完整提醒。我试过 NSCompoundPredicate
但 eventstore
不会获取不是使用其自己的谓词创建方法创建的谓词。有什么想法吗?
编辑:根据文档,为开始日期和结束日期传递 nil 会导致所有提醒,而不仅仅是没有到期日期的提醒。
最佳答案
编辑
您可以尝试过滤所有未完成的提醒,以仅获取没有截止日期的提醒:
[store fetchRemindersMatchingPredicate:predicate
completion:^(NSArray *reminders)
{
NSArray *myReminders = [reminders filteredArrayUsingPredicate:
[NSPredicate predicateWithFormat:@"dueDateComponents = nil"]];
NSLog(@"%@", myReminders);
}];
Documentation对于 predicateForIncompleteRemindersWithDueDateStarting:ending:calendars:
:
Discussion
Passnil
for startDate to find all reminders due before endDate. Similarly, passnil
for both startDate and endDate to get all incomplete reminders in the specified calendars.
关于ios - 搜索没有日期的 ios 提醒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15572163/