简体   繁体   中英

How to exchange data between Objective-C and PHP

I am playing around with Objective-C and have been looking for a good how-to example to exchange data it and PHP. JSON? SOAP? If anyone knows of a well written example I could hack at, I would appreciate it.

When you say exchange data, do you mean over a network connection, between programs or through files?

If you are look to transfer the data over an internet connection (eg. your Objective-C program has/is a web server) then I would personally use JSON as this would allow your Objective-C program to communicate with a javascript web app in future if required as well as the simple php json_encode / json_decode functions.

I would personally say the same applies to other systems, but depending on how you expect this to work something like xml or SOAP may work better.

Edit:

JSON Framework for Objective-C on Google Code

PHP Manual for JSON (including links on to json_encode and json_decode) functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM