简体   繁体   English

如何从Web服务器获取数据到iphone或ipod

[英]how to get data from web server to iphone or ipod

I'm quite new in iPhone development and I need to develop an app. 我是iPhone开发的新手,我需要开发一个应用程序。 I must get mp3 data from a web server, which provides a simple saving the mp3 in my app document or folder 我必须从Web服务器获取mp3数据,这样可以简单地将mp3保存在我的应用程序文档或文件夹中

and use it in an application, which should also dislpay a table with rows like: 并在一个应用程序中使用它,该应用程序也应该使用以下行来取消表:

song1 song2 song3 song1 song2 song3

But at present I don't know at all how to get this web page, parse it and store into an array in the application. 但目前我根本不知道如何获取此网页,解析它并存储到应用程序中的数组中。 Please do you have any suggestion / hint / sample code ? 请问您有任何建议/提示/示例代码吗?

Thank you in advance, 先感谢您,

There is a tutorial on the apple developer site on how to make a http request and receive data here . 有关于如何使一个HTTP请求和接收数据的苹果开发者网站的教程在这里 Should get you going on how to fetch the web page. 应该让你了解如何获取网页。

For parsing you can use the NSScanner or a XML/HTML parser library like TouchXML depending on your needs. 为了解析您可以使用NSScanner或XML / HTML解析库就像TouchXML根据您的需要。

I used web services to communicate with web server, the following tutorial helped me a lot. 我使用Web服务与Web服务器进行通信,以下教程对我帮助很大。 http://icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/ http://icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/

I was able to send and retrieve binary content using web service but I had to encode it first to be able to send it through Soap request and decode back Soap Response. 我能够使用Web服务发送和检索二进制内容,但我必须首先对其进行编码,以便能够通过Soap请求发送它并解码回Soap Response。 Hope that can help you, 希望能帮助你,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM