Inherit from SPManagedObject

前端 未结 1 1097
日久生厌
日久生厌 2021-01-14 22:20

In Simperiums iOS/OSX tutorial you say, each modeled object should inherit from SPManagedObject.

I didn\'t try it yet, but doesn\'t that lead to one big table in th

相关标签:
1条回答
  • 2021-01-14 22:30

    Yes, under the hood Core Data will tend to create a bigger table. Generally performance will suffer more from relations though, not inheritance: Using Parent Entity in CoreData Models

    We've done integrations with fairly complex inheritance hierarchies and didn't see any immediate issues with a fair amount of data.

    Having said that, should you need more control over your table structure, you can avoid having a single parent for all your objects and instead either:

    1. Manually add the ghostData and simperiumKey attributes to the objects you want to sync, and ensure their class is SPManagedObject (or ensure their custom class inherits from SPManagedObject), or

    2. Create more than one parent entity with ghostData and simperiumKey attributes, and inherit from those for the parts of your model where it makes sense, depending on how you'd like the underlying tables to be structured.

    0 讨论(0)
提交回复
热议问题