English 中文(简体)
Inherit from SPManagedObject
原标题:
  • 时间:2012-05-12 15:25:48
  •  标签:
  • simperium

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 the SQLite database that contains a union of all fields of all modeled managed objects?

最佳回答

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.

问题回答

暂无回答




相关问题
添加无法运行的应用程序

当我转到添加应用程序按钮时,输入我的Gmail地址,什么都不会发生,我也不会收到带有应用程序密钥的电子邮件。思想?

What are good SaaS message queue systems?

I m considering using a message queue-like system as the backend for a web application that would provide for synchronization between a web server, mobile applications and browsers. Are there any ...

Simperium couldn t load member data (unsupported type)

Trying to add Simperium to my existing app, I get a NSAssertion error: (gdb) po $eax Simperium couldn t load member data (unsupported type) Stack trace: (gdb) bt #0 0x02f63cbc in ...

Problems with dependencies of Simperium

I am evaluating to move a project to Simperium for synchronization. The project already uses CocoaHTTPServer, ASIHTTPRequest and some other frameworks. Now Simperium also seems to contain (at least ...

Inherit from SPManagedObject

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 the SQLite database that contains a ...

Simperium with a document base Core Data app

Is it possible to use Simperium (http://simperium.com) with a document based Core Data app? The sample is a "Shoebox" style app and I don t see any option to set a document id or something. If not, ...

热门标签