I am using NSXMLParser to parse this XML: http://itunes.apple.com/gb/rss/topsongs/limit=50/explicit=true/xml. I am trying to parse an element called “im:image”. My problem is that there are three elements with the name “im:image”. How can I only parse the data from the second “im:image”, or how can I add each single one to an array?
I am using NSXMLParser to parse this XML: http://itunes.apple.com/gb/rss/topsongs/limit=50/explicit=true/xml . I am trying to
Share
In the
didStartElementmethod of your custom delegate, checkattributesand ensure that it hasheightset to60(each of the ‘same’ XML elements has a different height attribute). Theattributesis anNSDictionarywith keys for name of the attributes and values for values of the attributes. Here is an example of roughly how you would do it: