NSDate
2秒で同じ日付であることを確認したい(時間は異なる場合があります)。私が現在持っているのはこれです:
- (NSPredicate*) predicateWithDate:(NSDate *)date {
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit ) fromDate:date];
//create a date with these components
NSDate *startDate = [calendar dateFromComponents:components];
[components setMonth:0];
[components setDay:1];
[components setYear:0];
NSDate *endDate = [calendar dateByAddingComponents:components toDate:startDate options:0];
return [NSPredicate predicateWithFormat:@"((ANY notes.date >= %@) AND (ANY notes.date < %@))",startDate,endDate];
}