2

任何尝试将 postgresql 与 xcode 连接到 ios 应用程序的人?我应该尝试什么?你有什么建议?

4

1 回答 1

4

The usual approach is to avoid making a direct connection but to route everything through an HTTP based API.

The iOS application then only needs to perform HTTP requests and parse the responses (which you can format using JSON).

You can write the HTTP API in the server side language of your choice.


It is possible to connect directly to the database, but you would have to write or otherwise acquire a Postgresql client library for iOS (which appears to exist, thanks Craig) and expose the database on the network (if the iOS application is going to connect over the Internet that means exposing the database directly to the Internet, which is generally considered to be a Bad Idea).

于 2012-07-10T11:21:57.267 回答