开发者

How to retrieve data from a website into an iphone app

开发者 https://www.devze.com 2023-01-27 11:39 出处:网络
I am making an iphone application. I am a newb. I want to fetch the data from my websit开发者_如何学编程e. What should i do to implement this?

I am making an iphone application.

I am a newb.

I want to fetch the data from my websit开发者_如何学编程e. What should i do to implement this?

What needs to be done?

Help me please

Thanks

Any tutorials would be of great help.


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

Hope this helps you


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


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


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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消