我正在使用 NSXMLParser 来解析 RSS 提要。早些时候我使用来自 cdata 块的图像 url,但现在我遇到了一个包含图像 url 的提要
<media:content url="http://cdn.example.com/wp-content/uploads/2013/10/article-2462931-18C5CBC000000578-776_634x452.jpg" medium="image"/>
我如何从这个标签中选择图片网址?这是我试图在 didStartElement 方法中使用的,但它不起作用:
if ([elementName isEqual:@"media:content"])
{
currentString = [[NSMutableString alloc] init];
// Basically i need the image url string at this point
NSString *imageURLString = [self getFirstImageUrl:currentString];
imageURL = [NSURL URLWithString:imageURLString];
[self downloadThumbnails:imageURL];
}
如何从媒体内容标签中选择图像 url 字符串?谢谢!