• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detect URL in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detect URL in NSTextView


  • Subject: Re: Detect URL in NSTextView
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 09 Mar 2005 12:44:45 -0800

On 2005-03-08 19:37:13 -0800 Adam <email@hidden> wrote:

I have an NSTextView that is the output of a chat session. If a user posts a line that contains a url (http://www.google.com), I would like to make it blue, underlined and clickable. Is there any simple way to do this?

Use whatever heuristic you choose for detecting URLs in the text. When you detect one, add the attribute NSLinkAttributeName to that range with the corresponding NSURL as a value.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Detect URL in NSTextView (From: Adam <email@hidden>)

  • Prev by Date: Re: NSEnumerator retaining objects?
  • Next by Date: Re: SystemStatusBar question
  • Previous by thread: Re: Detect URL in NSTextView
  • Next by thread: Re: Detect URL in NSTextView
  • Index(es):
    • Date
    • Thread