How to retrieve data from a website into an iPhone app

13.9k Views Asked by At

I am making an iPhone application. I am a beginner.

I want to fetch the data from my website. What should I do to implement this?

5

There are 5 best solutions below

1
On BEST ANSWER

If your problem is getting data from website to iphone then you can just use JSON Parsing to get data.

Just you have to pass all the data as JSON string in iPhone from your website. And then parse the data once received into your iPhone.

Here you can refer to this link:

http://www.raywenderlich.com/5492/working-with-json-in-ios-5

0
On

Previous answers suggest using NSURLConnection, but I find it to be a bit cumbersome to use on its own. I suggest using something that wraps NSURLConnection (or CFNetwork). Some examples: ASIHTTPRequest (CFNetwork-based), httpriot and Seriously (NSURLConnection/block-based).

3
On

For the server side, I suggest using a web service to send the data to your client.

ORIGINAL AUTHOR'S REVISION:

The September issue of Linux Journal has an excellent article on writing mobile apps that work for Android AND iPhone/iPad using free tools and frameworks. Here is a link to the article online:

Developing Portable Mobile Web Applications

6
On

Expose your data from your site as WebService, XML, JSON etc. Consume that using iPhone app. Which language is being used your site?depending on that some sample could be provided.

Chapter 10 of James Kennard, Mastering Joomla! 1.5 : APIs and Webservices contains 8 pages about XML-RPC.

For real-live examples, search the Joomla! Extension Directory. http://extensions.joomla.org/extensions/search/xml-rpc

Here is another one to kick-start http://www.slideshare.net/coolparth/rest-api-for-joomla

0
On

You will be using the NSURLConnection, NSURLRequest and NSURL classes here is an example from Apple; http://developer.apple.com/library/mac/ipad/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html