NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(date >= %@) AND (date <= %@)", startDate, endDate];
说startDate
是13/01/2017,endDate
是2017年1月15日。我希望限制请求的方式是每天不再返回10个项目。
因此,如果请求结果是
100 items with `date` == 13/01/2017
2 items with `date` == 14/01/2017
50 items with `date` == 15/01/2017
我需要像
一样10 items with `date` == 13/01/2017
2 items with `date` == 14/01/2017
10 items with `date` == 15/01/2017
我认为唯一的方法是每天创建循环并执行提取,以便获取请求的数量等于给定范围内的天数。另一个解决方案是执行一次提取,然后过滤这个大数组。我是对的吗?