Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make an URL in an NSTextFieldCell clickable

There are two parts to this question:

(1) How can I detect URLs in a given text?

(2) How can I make clickable a part of the text in a text field cell (in a table view)? I would like URLs, when clicked upon, to open in the default web browser.

like image 373
Enchilada Avatar asked Feb 16 '11 01:02

Enchilada


1 Answers

For making URLs clickable please take a look at this guide from Apple: Embedding Hyperlinks in NSTextField and NSTextView

For the first part, are you married to using an NSTextField? The reason is that NSTextView provides this automatically (it is just a checkbox in IB). Otherwise, have a look at this answer on StackOverflow regarding the Latent Semantic Mapping Framework.

I have not used it so I am afraid that I cannot offer any suggestions on it.

like image 106
sosborn Avatar answered Oct 27 '22 19:10

sosborn