0

现在我正在开发一个具有非常复杂的核心数据图的 ios 应用程序,但我也计划将它用于 android 和其他设备以及网页。

网页和其他设备可以通过多个数据库进行管理,但在 ios 中我使用的是核心数据,因为我发现对编程更友好。我的问题是,如果要为整个应用程序生态系统(web、android、html、ios)制作服务器,我是否能够将所有数据合并到一个服务器数据库中,包括核心数据?

4

1 回答 1

0

You can certainly merge the data, but not the database files. If you're storing and/or syncing data using a server, you'll need to define some kind of server API for client access. An iOS app using Core Data could also make use of that API to communicate with the server. So, yeah, should be do-able.

Your server side code will almost certainly be something SQL-based, so when communicating back and forth you'll probably end up mapping Core Data entities to SQL tables. That's fine, so long as the server API doesn't require too much SQL-specific, non-Core Data style data. For example: Core Data doesn't generally use anything like join tables, since it has real many-to-many relationships. It's possible to make an iOS app convert between Core Data relationships and SQLisms like that (I've done it) but it's kind of a pain in the ass. It's not generally necessary though-- decent server APIs don't simply expose the entire table structure in its raw form.

于 2013-03-09T00:08:59.620 回答