Search code examples
simperium

Simperium and Core Data relationships


Can Simperium work natively with Core Data relationships? Are there any configurations that are not supported?

Is it possible to define a relationship in Python or JavaScript and have it download to Core Data as a proper relationship?

Thanks


Solution

  • Yes, Simperium works natively with Core Data relationships. It doesn't support many-to-many relationships, but you can remodel these as two 1-to-many relationships according to Apple's guidelines and everything will work.

    Relationships can map to the Simperium Python and JavaScript libraries as well, and sync in both directions. You'll deal with lists of foreign keys (the simperiumKey in Core Data) that map to the corresponding objects. It's up to you to deal with these as you see fit; some people, for example, map the relationships onto Backbone.js models in JavaScript to achieve something that looks and feels a bit like Core Data, but on the web.