[英]Core Data NSPredicate NSDate filtering just for time
I have a NSManagedObject in Coredata with a NSDate property. 我在Coredata中有一个带有NSDate属性的NSManagedObject。
These NSDate contain different Days and Times, 这些NSDate包含不同的日期和时间,
I'd like to filter with NSPredicate but just by time, for example something like any day from 9:00 to 11:00. 我想使用NSPredicate进行过滤,但仅按时间过滤,例如从9:00到11:00的任何一天。
Any idea? 任何想法?
You could use predicateWithBlock: Core Data supports this method in the in-memory and atomic stores, but not in the SQLite-based store. 您可以使用predicateWithBlock:Core Data在内存和原子存储中支持此方法,但在基于SQLite的存储中不支持。 If you use the SQLite-based store, fetch all objects and then filter. 如果您使用基于SQLite的存储,则获取所有对象,然后进行过滤。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.