NSPredicateEditor: filter for month in NSDate object

26 views Asked by At

How can I filter a NSDate object by month with NSPredicateEditor ?

I have created a separate predicate editor row template for month. Then Key Path is set to "myDate.month" and a right expression as numbers. That doesn't work, it tells that myDate.month is not KVO compliant. I have no idea how to use DateComponents in the key path either.

Of course, I could enrich my data model to an attribute "month" and then filter for it. But it is not very elegant and it means to maintain date and month for any updates at the same time..

0

There are 0 answers