Re: Core Data, NSPredicate, and NSDates
Re: Core Data, NSPredicate, and NSDates
- Subject: Re: Core Data, NSPredicate, and NSDates
- From: "I. Savant" <email@hidden>
- Date: Wed, 25 Jul 2007 10:25:21 -0400
On 7/25/07, Kevin <email@hidden> wrote:
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]];
How about a predicate with a range?
[NSPredicate predicateWithFormat:@"dueDate BETWEEN %@",
[NSArray arrayWithObjects:
beginningOfDay, endOfDay, nil]];
Taken from here:
http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/index.html?http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Articles/pUsing.html
--
I.S.
_______________________________________________
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