求教一个关于CoreData里NSPredicate的用法问题
2015-07-21 · 知道合伙人软件行家
关注
展开全部
NSDate *endDate = [NSDate date];
NSTimeInterval timeInterval= [endDate timeIntervalSinceReferenceDate];
timeInterval -=3600*24;
NSDate *beginDate = [NSDate dateWithTimeIntervalSinceReferenceDate:timeInterval];
//过期的日期
NSPredicate *predicate_date =
[NSPredicate predicateWithFormat:@"date <= %@", beginDate];
[fetchRequest setPredicate:predicate_date];
NSTimeInterval timeInterval= [endDate timeIntervalSinceReferenceDate];
timeInterval -=3600*24;
NSDate *beginDate = [NSDate dateWithTimeIntervalSinceReferenceDate:timeInterval];
//过期的日期
NSPredicate *predicate_date =
[NSPredicate predicateWithFormat:@"date <= %@", beginDate];
[fetchRequest setPredicate:predicate_date];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询