Re: NSArrayController filterPredicate and dates
Re: NSArrayController filterPredicate and dates
- Subject: Re: NSArrayController filterPredicate and dates
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 10 May 2006 20:09:53 -0700
On May 10, 2006, at 4:56 PM, Ken Victor wrote:
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
Core Data dates are stored as NSDate objects:
<http://developer.apple.com/documentation/Cocoa/Reference/
CoreData_ObjC/Classes/NSAttributeDescription.html#//apple_ref/doc/
c_ref/NSDateAttributeType>
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).
Are any date attribute values *exactly* the same as the value you're
comparing with, down to the final decimal place?
mmalc
_______________________________________________
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