tôi thấy đoạn này ít cho phép một để tạo ra các liên kết từ văn bản trong một NSTextView:Tạo một liên kết trong ứng dụng trong NSTextView
-(void)setHyperlinkWithTextView:(NSTextView*)inTextView
{
// create the attributed string
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init];
// create the url and use it for our attributed string
NSURL* url = [NSURL URLWithString: @"http://www.apple.com"];
[string appendAttributedString:[NSAttributedString hyperlinkFromString:@"Apple Computer" withURL:url]];
// apply it to the NSTextView's text storage
[[inTextView textStorage] setAttributedString: string];
}
Nó sẽ có thể để có điểm liên kết đến một số tài nguyên trong ứng dụng của tôi , ví dụ như một lớp trình xử lý cụ thể có khả năng diễn giải các liên kết và gửi đến một khung nhìn/bộ điều khiển tương ứng?