NSArrayController filterPredicate and dates
NSArrayController filterPredicate and dates
- Subject: NSArrayController filterPredicate and dates
- From: Ken Victor <email@hidden>
- Date: Wed, 10 May 2006 16:56:47 -0700
i've got a table view that uses an array controller bound to one of
the entities in my core data model. in response to user actions, i
set the filterPredicate of the array controller. and all is good...
most of the time!
the problem occurs if i use a predicate of the form:
<date field key> == NSCalendarDate
or <date field key> != NSCalendarDate
if instead of comparing for (in)equality, i compare <. <=, >, or >=
all works as expected. i believe this indicates that i am building
the predicate properly.
if i look at my built predicate with the debugger, i see what i would
expect to see:
startDate == CAST(168993946.767526, "NSDate")
where the float inside the cast corresponds to the user specified
date. and when i look at my accessor method for startDate, it returns
the expected value (as an NSCalendarDate).
yet, my table is empty as if nothing passes the predicate.
i tried changing my accessor to return an NSDate (instead of a
NSCalendarDate) and it didn't help. i tried creating the
NSComparisonPredicate using a customSelector (isEqualToDate:) and
this didn't help either.
can anyone please offer any insights/suggestions/help/anything? :-)
thanx,
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden