I found another easy way to show links in an NSTextField. You can use HTML. Here is a quick example:
-(NSAttributedString *)stringFromHTML:(NSString *)html withFont:(NSFont *)font
{
if (!font) font = [NSFont systemFontOfSize:0.0];
html = [NSString stringWithFormat:@"<span style=\"font-family:'%@'; font-size:%dpx;\">%@</span>", [font fontName], (int)[font pointSize], html];
NSData *data = [html dataUsingEncoding:NSUTF8StringEncoding];
NSAttributedString* string = [[NSAttributedString alloc] initWithHTML:data documentAttributes:nil];
return string;
}
:
[tf setAllowsEditingTextAttributes: YES];
[tf setSelectable:YES];
NSString *credits = @"Visit our <a href=\"http:
[tf setAttributedStringValue:[self stringFromHTML:credits withFont:[tf font]]];