NSPredicate not working with calculated field

被刻印的时光 ゝ 提交于 2019-12-06 12:34:39

By calculated, I assume you mean that the property is transient. If this is the case then you are not able to search on those properties. This is because the property may not be created at the time that the search is executed for all the core data entities you are searching on. From the Core Data Programming Guide (just after Listing 1):

You cannot fetch using a predicate based on transient properties (although you can use transient properties to filter in memory yourself).

So, if you would like to use a predicate to filter on that property you will need to make the attribute non transient.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!