我有以下代码:检查URL是一个图像
NSDataDetector* detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil];
NSArray* matches = [detector matchesInString:[[imagesArray valueForKey:@"content"] objectAtIndex:indexPath.row] options:0 range:NSMakeRange(0, [[[imagesArray valueForKey:@"content"] objectAtIndex:indexPath.row] length])];
这一结果在日志中:
<NSLinkCheckingResult: 0xa632220>{235, 75}{http://URL/wordpress/wp-content/uploads/2014/04/Digital-Board-2.png}
<NSLinkCheckingResult: 0xa64eb90>{280, 25}{http://www.w3schools.com/}
我需要做的是检查链接它们是否包含一个图像。在这种情况下,第一个链接包含一个图像(PNG)。第二个不是。我怎样才能做到这一点?
@Leetmorry thanx的编辑:) – Alladinian