I have an RSS feed with the image of the feed encoded like this:
<imageItem src="http://www.example.com/picture.jpg">
<img width="386" height="173" src="http://www.abb-conversations.com/DACH/files/2015/06/Traumpraktikum-755-386x173.jpg" class="attachment-teaser-tablet wp-post-image" alt="Traumpraktikum-755" style="float:left; margin:0 15px 15px 0;"/>
</imageItem>
Using NSXMLParser, I was to be able to extract that src link. Currently the way I'm doing it does not return anything because it is looking for something like <imageItem> xxx.jpg </imageItem>
.
Here is the code:
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
if ([self.element isEqualToString:@"title"]) {
[self.title appendString:string];
}
else if ([self.element isEqualToString:@"link"]) {
[self.link appendString:string];
}
else if ([self.element isEqualToString:@"imageItem"]) {
[self.image appendString:string];
}
}
Try this delegate method