I understand that a NSURL is returned on the NSTextCheckingResult, but how can you get back to the original string. NSURL formats the url, unless there is a method on here that gets you back to the original url.
NSError *error = nil;
NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:
(NSTextCheckingTypeLink | NSTextCheckingTypePhoneNumber)
error:&error];
[detector enumerateMatchesInString:html
options:0
range:NSMakeRange(0, [html length])
usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
if (result.resultType == NSTextCheckingTypeLink) {
NSLog(@"original string is %@", ???);
}
}
}];
Try:
Or get whatever you want to know about the URL.