I am starting to develop applications for the iPhone and I want to create an application that includes extracting data from a web application. I will develop the API using PHP and the Zend Framework. I have never created a public API before, nor an iPhone application that works with public data.
Here are some specific questions I have:
One of the things I will need to do is create a table view with data from the API.
- What data format should the API return? XML, JSON, HTML? (I assume XML will be the easiest)
Say my API has a function fetchAllthat returns all the records in a database table, how can I format this data so that it works easily in my iPhone application?
array(
0 => 'John',
1 => 'Sally',
2 => 'Chris'
)
Update: . After a series of studies, I decided that (on the server side) I want to implement a RESTful API that returns JSON. Thus, my iPhone application will eventually become a REST client.
I also found this post, although it may be deprecated now: Creating RESTful Web Service Clients in Cocoa and Cocoa Click
source
share