• 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: Kosher use of textView:shouldChangeTextInRange:replacementString?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kosher use of textView:shouldChangeTextInRange:replacementString?


  • Subject: Re: Kosher use of textView:shouldChangeTextInRange:replacementString?
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 9 Jan 2007 13:43:10 -0800


On Jan 9, 2007, at 1:40 PM, Peter Seibel wrote:

On Jan 9, 2007, at 12:40 PM, Douglas Davidson wrote:


On Jan 9, 2007, at 12:32 PM, Peter Seibel wrote:

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?

Better to record what's changing and clean things up in textDidChange.

Why? I believe you--in fact that was how I first implemented it-- I'm just curious.

That makes it more likely to work with other things that key off of the should/did change mechanism, e.g. undo.


Douglas Davidson

_______________________________________________

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


References: 
 >Kosher use of textView:shouldChangeTextInRange:replacementString? (From: Peter Seibel <email@hidden>)
 >Re: Kosher use of textView:shouldChangeTextInRange:replacementString? (From: Douglas Davidson <email@hidden>)
 >Re: Kosher use of textView:shouldChangeTextInRange:replacementString? (From: Peter Seibel <email@hidden>)

  • Prev by Date: Re: Kosher use of textView:shouldChangeTextInRange:replacementString?
  • Next by Date: Re: nodesForXPath almost always returns no objects
  • Previous by thread: Re: Kosher use of textView:shouldChangeTextInRange:replacementString?
  • Next by thread: Scaleable Toolbar Items
  • Index(es):
    • Date
    • Thread