Core Data, NSPredicate, and NSDates
Core Data, NSPredicate, and NSDates
- Subject: Core Data, NSPredicate, and NSDates
- From: Kevin <email@hidden>
- Date: Wed, 25 Jul 2007 08:25:18 -0500
I have an entity called Task which contains a dueDate property. I'd
like to fetch all Tasks which have a dueDate of TODAY.
When the dueDate for a Task is set, I use an NSDate instance
initialized to whatever the user picked using NSDatePicker.
How can I construct the NSPredicate for the fetch request such that
tasks that are due today are returned? Simply using a predicate like
the following doesn't work as it takes into account the time portion
of the date.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"dueDate =
%@", [NSDate date]];
- Kevin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden