开发者

Console result in view

Hi I am calling a web service in objective c,and i am receiving the xml response in the console. The problem is that i am not able to take data from xml to my view. The response is a list,and each item has 4 element开发者_如何学JAVAs Any help


You need to parse the XML response. In OS X there are two approaches to this.

The first is to use NSXMLParser. This is an example of a SAX parser. It treats the XML as a stream and runs through it, sending callback messages to a delegate whenever it finds something interesting e.g. the start / end of an element or data within an element.

The second is NSXMLDocument. This treats the XML as a document. The XML is loaded all in one go and you get a tree of XML nodes that reflect the structure and data of your XML.

NSXMLDocument is easier to work with but requires much more memory than NSXMLParser. It's also not available on iOS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜