How to connect to postgresql from ios9

青春壹個敷衍的年華 提交于 2019-12-06 15:56:29

if anyone still having the same issue like I did, after a long struggled I got a solution!(I was trying to find or modified all kind of the existing "Kits","framework")

I was surprised, what I was looking for, could be so rarely, suddenly very envious those android developer.

The simple step as follow.

  1. Go find a libpq.framework.
  2. You have to create a C type file(because libpq is not Obj-c.) as C API to connect libpq.
  3. After that create a Bridging-Header to connect it.(It Bridging will not generate its own)
  4. Back to the C type file you created
  5. Follow this "PostgreSQL C Language API" tutorial this tutorial saved me a lot of time .(C has been a very far away from me.)
  6. If need, go to Build Settings >> Enable Bitcode >> YES
  7. Make sure test it on the device.

I will post the sample code on git and share the link, after I finish my project.

:) Cheers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!