Question

I need to persist up to a maximum of about 100 complex objects (call them Object A). I say complex because each object is composed of other nested heirarchical objects.

I decided against storing them in core data because of their complex object graphs, so I was thinking of using archiving for persisting these objects.

However, I need to form relationships between these objects and other managed objects in core data (call them Object B). The cardinality is one object A (archived) to many object Bs (core data).

My question is, what would be the best way of doing this? I thought of using UUIDs for each archived object A and storing references to those UUIDs as string attributes in core data for Object B.

But I understand there may be performance and storage penalties associated with doing this. Is there another type of object ID for Object A perhaps that I may use?

Was it helpful?

Solution

It seems for all the effort you are going to put into mapping between CoreData and your archived object, it would just be easier to put it all through CoreData. If you have "complex" properties in this object that makes using CoreData undesirable, don't forget that CoreData has a transformable property. This might be what you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top