Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method
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