• 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
Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method


  • Subject: Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method
  • From: Martin Schürrer <email@hidden>
  • Date: Thu, 19 May 2011 19:23:21 +0200

Hi,

I want to highlight @mentions, #hashtags and links in an NSTextView as
the user types. I've been thinking I'd implement this via the
shouldChangeTextInRange delegate method.

My plan is as follows:
I'm going to construct the new string (via
stringByReplacingCharactersInRange:affectedCharRange
withString:replacementString) and check the word (chain of chars
separated by spaces on both ends) that's changed and highlight only
this word.

I'm a total cocoa newbie so I'm not sure, is this a good plan? Is
there already code out there that does the stuff I want?

Thanks,
Martin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method
      • From: Ross Carter <email@hidden>
  • Prev by Date: Re: Installing application on a network onto several computers
  • Next by Date: Re: Can't create temporary file
  • Previous by thread: Re: "Use them from only one thread at a time"
  • Next by thread: Re: Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method
  • Index(es):
    • Date
    • Thread