任何尝试将 postgresql 与 xcode 连接到 ios 应用程序的人?我应该尝试什么?你有什么建议?
1 回答
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).