How to retrieve data from a website into an iphone app

╄→гoц情女王★ 提交于 2019-12-23 06:43:26

问题


I am making an iphone application.

I am a newb.

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

What needs to be done?

Help me please

Thanks

Any tutorials would be of great help.


回答1:


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




回答2:


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




回答3:


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




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/4295506/how-to-retrieve-data-from-a-website-into-an-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!