Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Data: Store cannot hold instances of entity (Cocoa Error: 134020)
    primarykey
    data
    text
    <p>This is the strangest error. <a href="http://www.cocoabuilder.com/archive/cocoa/225533-coredata-mystery-configuration-used-to-open-the-store-is-incompatible.html" rel="noreferrer">The internet</a> suggests that this is an issue with targeting Tiger; except that I'm actually targeting iOS 3 and 4.</p> <pre><code>Error Domain=NSCocoaErrorDomain Code=134020 "The operation couldn\u2019t be completed. (Cocoa error 134020.)" UserInfo=0xc502350 {NSAffectedObjectsErrorKey=&lt;PartRecommendation: 0x6a113e0&gt; (entity: PartRecommendation; id: 0x6a0d0e0 &lt;x-coredata:///PartRecommendation/tAE2B5BA2-44FD-4B62-95D7-5B86EBD6830014&gt; ; data: { "_rkManagedObjectSyncStatus" = 0; name = "Thin canopy cover"; part = nil; partRecommendationId = 6; partType = "0x6a07f40 &lt;x-coredata:///PartType/tAE2B5BA2-44FD-4B62-95D7-5B86EBD683003&gt;"; }), NSUnderlyingException=Store &lt;NSSQLCore: 0x5f3b4c0&gt; cannot hold instances of entity (&lt;NSEntityDescription: 0x6d2e5d0&gt;) name PartRecommendation, managedObjectClassName PartRecommendation, renamingIdentifier PartRecommendation, isAbstract 0, superentity name PartOption, properties { "_rkManagedObjectSyncStatus" = "(&lt;NSAttributeDescription: 0x6d37550&gt;), name _rkManagedObjectSyncStatus, isOptional 0, isTransient 0, entity PartRecommendation, renamingIdentifier _rkManagedObjectSyncStatus, validation predicates (\n), warnings (\n), versionHashModifier (null), attributeType 100 , attributeValueClassName NSNumber, defaultValue 0"; name = "(&lt;NSAttributeDescription: 0x6d37c10&gt;), name name, isOptional 1, isTransient 0, entity PartRecommendation, renamingIdentifier name, validation predicates (\n), warnings (\n), versionHashModifier (null), attributeType 700 , attributeValueClassName NSString, defaultValue (null)"; part = "(&lt;NSRelationshipDescription: 0x6d2e660&gt;), name part, isOptional 1, isTransient 0, entity PartRecommendation, renamingIdentifier part, validation predicates (\n), warnings (\n), versionHashModifier (null), destination entity Part, inverseRelationship recommendation, minCount 1, maxCount 1"; partRecommendationId = "(&lt;NSAttributeDescription: 0x6d2e6d0&gt;), name partRecommendationId, isOptional 1, isTransient 0, entity PartRecommendation, renamingIdentifier partRecommendationId, validation predicates (\n), warnings (\n), versionHashModifier (null), attributeType 100 , attributeValueClassName NSNumber, defaultValue 0"; partType = "(&lt;NSRelationshipDescription: 0x6d2e720&gt;), name partType, isOptional 1, isTransient 0, entity PartRecommendation, renamingIdentifier partType, validation predicates (\n), warnings (\n), versionHashModifier (null), destination entity PartType, inverseRelationship partRecommendations, minCount 1, maxCount 1"; }, subentities { }, userInfo { }, versionHashModifier (null)} </code></pre> <p>I'm adding a lot of data to Core Data before I get this error, but I'm saving twice (once in the middle, then again at the end). Everything is fine after the first save, it's the second save that is causing the problem, so I'll post the code that I'm using after the first but before the second.</p> <pre><code>Landscape *landscape = [Landscape object]; Type *type = [Type object]; type.name = @"tree"; MeasurementType *caliperType = [MeasurementType object]; MeasurementType *heightType = [MeasurementType object]; InventoryTree *inventoryTree = [InventoryTree object]; inventoryTree.landscape = landscape; inventoryTree.type = type; Assessment *assessmentTree = [Assessment object]; assessmentTree.inventoryItem = inventoryTree; assessmentTree.type = type; [[inventoryTree mutableSetValueForKeyPath:@"assessments"] addObject:assessmentTree]; Measurement *caliper = [Measurement object]; Measurement *height = [Measurement object]; caliper.type = caliperType; height.type = heightType; [[assessmentTree mutableSetValueForKey:@"measurements"] addObjectsFromArray:[NSArray arrayWithObjects:caliper, height, nil]]; for (PartType *pType in [PartType allObjects]) { pType.type = type; Part *treePart = [Part object]; treePart.partType = pType; [[assessmentTree mutableSetValueForKey:@"parts"] addObject:treePart]; for (PartCondition *cond in pType.partConditions) { cond.partType = pType; } for (PartRecommendation *rec in pType.partRecommendations) { rec.partType = pType; } } </code></pre> <p>The convenience methods I'm calling on NSManagedObject subclasses can be found <a href="https://raw.github.com/RestKit/RestKit/9e56cfa1e23fbf41e89209fb6edbce6d26e9022d/Code/CoreData/NSManagedObject+ActiveRecord.m" rel="noreferrer">here</a>.</p> <p>I have methods elsewhere in the app (long after this runs) that can add/edit/delete all of the entities referenced above. The error doesn't occur on the same entity every time.</p> <p>Any help would be greatly appreciated! This is a tricky one.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload