Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search ios reminders without date

I'm familiar with using the eventstore search predicates like predicateForIncompleteRemindersWithDueDateStarting:Ending:Calendars:

but I'm trying to figure out how I can search for any incomplete reminders that don't have any due date set. I've tried NSCompoundPredicate but eventstore won't fetch a predicate that's not created with its own predicate creation methods. Any ideas?

Edit: As per the documentation, passing nil for both start and end dates results in all reminders, not solely reminders without dueDates.

like image 439
user1869469 Avatar asked Jun 01 '26 08:06

user1869469


1 Answers

EDIT

You can try to filter all incomplete reminders to get only without due date:

[store fetchRemindersMatchingPredicate:predicate
                            completion:^(NSArray *reminders)
     {
         NSArray *myReminders = [reminders filteredArrayUsingPredicate:
                                 [NSPredicate predicateWithFormat:@"dueDateComponents = nil"]];
         NSLog(@"%@", myReminders);
     }];

Documentation for predicateForIncompleteRemindersWithDueDateStarting:ending:calendars::

Discussion
Pass nil for startDate to find all reminders due before endDate. Similarly, pass nil for both startDate and endDate to get all incomplete reminders in the specified calendars.

like image 76
Sergey Kuryanov Avatar answered Jun 04 '26 11:06

Sergey Kuryanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!