Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Coredata saving error

I'm trying to create core data application. Some times when trying to save data, i'm seeing following error:

Error: NSInvalidArgumentException, Reason: * -_referenceData64 only defined for abstract class. Define -[NSTemporaryObjectID_default _referenceData64]!, Description: * -_referenceData64 only defined for abstract class. Define -[NSTemporaryObjectID_default _referenceData64]!

I didn't understand why this error is coming and how to avoid it. Can some one help me please.

like image 440
Satyam Avatar asked Sep 19 '25 00:09

Satyam


1 Answers

Edit: The original answer below is technically correct but doesn't accurately describe the true source of the error. The runtime can't find the correct attribute but the reason it can't find it is because the entity exist in another managed object context. The OP probably never had a _referenceData64 attribute for any of his entities.

See: http://www.cocoadev.com/index.pl?TemporaryObjectIdsDoNotRespondToReferenceData

Original Answer:

You have a class that has an attribute _referenceData64. In the data model, that class is marked as "abstract'. Select the entity in data model editor and check the box below that says "abstract". If it is checked, then that is your problem.

An abstract entity is never instantiated. Unless is has a subclass, you can't actually set its attributes to any value. Abstract entities just exist to provide templates for subclasses.

like image 112
TechZen Avatar answered Sep 20 '25 15:09

TechZen