对不起,我的英语,但我需要过滤我的表根据我的第三个数据(我已经添加了这个数据后,我的表)。在日志中,我看到我的应用程序不检索myThirdData,但是如果我记录实体属性的话。还有myThirdData。这是我的日志:
"(<NSAttributeDescription: 0x8dbc390>), name myFirstData, isOptional
1, isTransient 0, entity Targhe, renamingIdentifier dataIns,
validation predicates (\n), warnings (\n), versionHashModifier
(null)\n userInfo {\n \"com.apple.syncservices.Syncable\" = NO;\n},
attributeType 900 , attributeValueClassName NSDate, defaultValue
(null)",
"(<NSAttributeDescription: 0x8dbc280>), name mySecondData, isOptional 0, isTransient 0, entity Targhe, renamingIdentifier targa,
validation predicates (\n \"length <= 7\"\n), warnings (\n
1660\n), versionHashModifier (null)\n userInfo {\n}, attributeType 700
, attributeValueClassName NSString, defaultValue (null)"
"(<NSAttributeDescription: 0x8dbc010>), name myThirdData, isOptional
0, isTransient 1, entity Targhe, renamingIdentifier utente, validation
predicates (\n), warnings (\n), versionHashModifier (null)\n userInfo
{\n}, attributeType 700 , attributeValueClassName NSString,
defaultValue (null)" ) [...] 2015-01-06 09:56:40.211
myProject[581:60b] CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT,
t0.ZMYFIRSTDATA, t0.ZMYSECONDDATA FROM ZMYENTITY t0 WHERE t0.Z_PK IN
(?,?,?,?,?,?) ORDER BY t0.ZMYFIRSTDATA DESC LIMIT 20当我添加谓词时,我有一个错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath myThirdData not found in
entity <NSSQLEntity MyEntity id=1>'这是我的谓词:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"myThirdData = %@", myThirdDataVar];
[fetchRequest setPredicate:predicate];发布于 2015-01-06 09:57:19
数据存储中不存在瞬态属性,因此不能在MOC上运行的谓词中使用它们。要么您需要使属性非瞬态,要么您需要进行一个提取,然后过滤结果(尽管在提取之后,所有的瞬态都为空)。
https://stackoverflow.com/questions/27795451
复制相似问题