I use SDWebImage to download the Pictures from my parsed XML file, and display it in a TableView. But the problem is that some images are not shown. This it how it looks like:
This is my code for parsing out the first image and displaying it in the TableView Cell:
// Parse out Image URL for cell
NSError *error = NULL;
NSRegularExpression *regexImage = [NSRegularExpression regularExpressionWithPattern:@"(<img\\s[\\s\\S]*?src\\s*?=\\s*?['\"](.*?)['\"][\\s\\S]*?>)+?"
options:NSRegularExpressionCaseInsensitive
error:&error];
[regexImage enumerateMatchesInString:item.content
options:0
range:NSMakeRange(0, [item.content length])
usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
NSString *src = [item.content substringWithRange:[result rangeAtIndex:2]];
NSLog(@"img src: %@", src);
[cell.imageView setImageWithURL:[NSURL URLWithString:src] placeholderImage:[UIImage imageNamed:@"Placeholder.png"]];
}];