Can I set transient properties to fetch?

点点圈 提交于 2019-12-07 01:30:49

问题


I want to create NSFetchRequest and set properties to fetch like this:

request.propertiesToFetch = @[@"a", @"b", @"c"];

where a and b are stored in Core Data database, and c is transient. executeFetchRequest: fires an error Invalid keypath c passed to setPropertiesToFetch:. But if I uncheck transient-checkbox for property c everything will work fine. So is it really impossible to fetch transient properties or I'm doing something wrong?


回答1:


Yes, it is really impossible. You can't fetch them because they don't exist in the persistent store - that's what it means to be transient. You can fetch whatever persistent attributes the derived, transient, attribute is created from.



来源:https://stackoverflow.com/questions/18096577/can-i-set-transient-properties-to-fetch

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