5

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.

Enchilada
  • 3,859
  • 1
  • 36
  • 69

1 Answers1

9

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.

Community
  • 1
  • 1
sosborn
  • 14,676
  • 2
  • 42
  • 46