À l'aide de NSXMLParser avec CDATA

Je suis à l'analyse d'un flux RSS avec NSXMLParser, et il fonctionne très bien pour le titre et d'autres chaînes de caractères, mais un des éléments est une image c'est comme

<!CDATA <a href="http:image..etc> 

Comment puis-je ajouter que, comme ma cellule image dans ma table? Je définirais comme un type d'image?

C'est ce que j'utilise pour faire mon analyse:

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{            
//NSLog(@"found this element: %@", elementName);
currentElement = [elementName copy];
if ([elementName isEqualToString:@"item"]) {
    //clear out our story item caches...
    item = [[NSMutableDictionary alloc] init];
    currentTitle = [[NSMutableString alloc] init];
    currentDate = [ [NSMutableString alloc] init];
    currentSummary = [[NSMutableString alloc] init];
    currentLink = [[NSMutableString alloc] init];
}

}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{     
//NSLog(@"ended element: %@", elementName);
if ([elementName isEqualToString:@"item"]) {
    //save values to an item, then store that item into the array...
    [item setObject:currentTitle forKey:@"title"];
    [item setObject:currentLink forKey:@"link"];
    [item setObject:currentSummary forKey:@"description"];
    [item setObject:currentDate forKey:@"date"];

    [stories addObject:[item copy]];
    NSLog(@"adding story: %@", currentTitle);
}

}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
//NSLog(@"found characters: %@", string);
//save the characters for the current item...
if ([currentElement isEqualToString:@"title"]) {
    [currentTitle appendString:string];
} else if ([currentElement isEqualToString:@"link"]) {
    [currentLink appendString:string];
} else if ([currentElement isEqualToString:@"description"]) {
    [currentSummary appendString:string];
} else if ([currentElement isEqualToString:@"pubDate"]) {
    [currentDate appendString:string];
}

}

OriginalL'auteur Xcoder | 2009-07-08