How to exchange data between Objective-C and PHP

204

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.

89

Answer

Solution:

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.

People are also looking for solutions to the problem: php - [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.