取得的财产不起作用

时间:2013-08-16 07:50:15

标签: ios core-data fetched-property

我有一个核心数据设置,包含2个配置,也就是2个存储文件(一个包含所有具有预定义内容的实体(noBackup商店),另一个包含用户生成的内容(backupStore)。

在我的示例中,备份存储中的一个实体在noBackup存储中有一个fetchedProperty。 相关实体的NSEntitiDescription看起来像这样。

$ 2 = 0x07b7a790()名称PilotMedical,managedObjectClassName PilotMedical,renamingIdentifier PilotMedical,isAbstract 0,superentity name(null),properties {     classCreationDate ="(),name classCreationDate,isOptional 0,isTransient 0,entity PilotMedical,renamingIdentifier classCreationDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     classExpirationDate ="(),name classExpirationDate,isOptional 0,isTransient 0,entity PilotMedical,renamingIdentifier classExpirationDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;      country ="(),name country,isOptional 1,isTransient 1,entity PilotMedical,renamingIdentifier country,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n },fetchRequest(entity:Country; predicate:(country_id == $ FETCH_SOURCE.country_id); sortDescriptors:((null)); type:NSManagedObjectResultType;)&#34 ;;     " COUNTRY_ID" ="(),名称为country_id,isOptional 1,isTransient 0,实体PilotMedical,renamingIdentifier country_id,验证谓词(\ n),警告(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 100 ,attributeValueClassName NSNumber,defaultValue 0&#34 ;;     initialExamDate ="(),name initialExamDate,isOptional 0,isTransient 0,entity PilotMedical,renamingIdentifier initialExamDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     lastAudioExamDate ="(),name lastAudioExamDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier lastAudioExamDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     lastEKGDate ="(),名称为lastEKGDate,isOptional 1,isTransient 0,实体PilotMedical,renamingIdentifier lastEKGDate,验证谓词(\ n),警告(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     lastOcularExamDate ="(),name lastOcularExamDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier lastOcularExamDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     lastRenewalDate ="(),name lastRenewalDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier lastRenewalDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     medicalClass ="(),name medicalClass,isOptional 0,isTransient 0,entity PilotMedical,renamingIdentifier medicalClass,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 700,attributeValueClassName NSString,defaultValue undefined&#34 ;;     nextAudioExamDate ="(),name nextAudioExamDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier nextAudioExamDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     nextEKGDate ="(),name nextEKGDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier nextEKGDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     nextOcularExamDate ="(),name nextOcularExamDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier nextOcularExamDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     nextRenewalDate ="(),name nextRenewalDate,isOptional 1,isTransient 0,entity PilotMedical,renamingIdentifier nextRenewalDate,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},attributeType 900,attributeValueClassName NSDate,defaultValue(null)&#34 ;;     pilot ="(),name pilot,isOptional 0,isTransient 0,entity PilotMedical,renamingIdentifier pilot,validation predicates(\ n),warnings(\ n),versionHashModifier(null)\ n userInfo {\ n},destination entity Pilot,inverseRelationship pilotMedical,minCount 1,maxCount 1,isOrdered 0,deleteRule 1&#34 ;; },subentities(null),userInfo { },versionHashModifier(null)

但是一旦我访问国家/地区值,就会引发异常。 跟踪就在这里。似乎我有一个未定义的密钥,但国家实体有country_id属性。所以我不知道我还能做些什么。

enter image description here

我已经使用给定的country_id使用普通的获取请求获取了country对象,但它确实有效。 我已经开启了sql debug,但之前没有生成语句。

我还能做什么?

0 个答案:

没有答案