1
votes

I have to store a collection of custom objects (Dictonary) in Core Data Database. So far so good. The Dictonary is stored and can be loaded without problems as a "Transformable" object.

The custom Object holds properties, but these are nil after loading them from the Database. After searching a lot, I haven't found anything for this problem. It seems that the properties are not getting stored in this way. (Maybe because only the address is stored and not the data??)

Sure it would be better to store an object of Core Data supported datatypes, but in this case the transformable Object is just fine and saves me a lot work and time.

Thank U!

1

1 Answers

0
votes

The whole idea of transformable objects is covered in the Core Data Guide. Note that this uses a keyed archiver / unarchiver to create a NSData object from your object or the reverse. This means your customer objects my adhere to NSCoding, and encode all the information in them when asked to as well as handle unencoding.

If your are not doing this now this is the root cause of your problem. What I suggest you do is adopt NSCoding in one custom object, then verify that in fact you can encode it to a NSData object, then from the object unencode it and get the same object back. When you have that working you can then test with Core Data.