Kosher use of textView:shouldChangeTextInRange:replacementString?
Kosher use of textView:shouldChangeTextInRange:replacementString?
- Subject: Kosher use of textView:shouldChangeTextInRange:replacementString?
- From: Peter Seibel <email@hidden>
- Date: Tue, 9 Jan 2007 12:32:53 -0800
Is it good form to implement the
textView:shouldChangeTextInRange:replacementString method in a
NSTextView delegate to return NO after directly manipulating the
NSTextStorage. I'm working on a simple word processor that uses some
extra attributes attached to the text in the NSTextStorage for its
own purposes. When text is changed in response to user actions I may
need to clean up some of the attributes of surrounding text. In other
cases I may also need to manipulate the text itself, inserting or
removing list markers. Is this method the right place to do that. Or
should I just record information here about what's changing and then
clean things up in textDidChange?
Or should I do something completely different like subclass
NSTextView or even NSTextStorage?
-Peter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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