Look at the docs for this method. The first parameter needs to be of type NSTextCheckingTypes. But the value you pass in, NSTextCheckingTypeLink, is of type NSTextCheckingType.
You need to pass in either NSTextCheckingAllSystemTypes, NSTextCheckingAllCustomTypes, or NSTextCheckingAllTypes.
Edit:
Upon further review, while what I stated seems correct from a parameter point of view, the rest of the docs for the method claim something else that contradicts the parameter type. Either something changed or this is a bug. Someone should report this to Apple.
Further edit:
One workaround would be to make use of a cast:
NSDataDetector *detector =
[NSDataDetector dataDetectorWithTypes:(NSTextCheckingTypes)NSTextCheckingTypeLink
error:&error];