• 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: Tracking NSTextFinder changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tracking NSTextFinder changes


  • Subject: Re: Tracking NSTextFinder changes
  • From: Graham Cox <email@hidden>
  • Date: Tue, 01 Jul 2014 14:21:48 +1000

On 1 Jul 2014, at 2:08 pm, Shane Stanley <email@hidden> wrote:

> I have a text view subclass, and I need to know when its contents have been changed. I have been overriding -shouldChangeTextInRange:replacementString:, but that does not get called if the user performs a replace via the find bar.
>
> I tried observing the view's text storage's NSTextStorageDidProcessEditingNotification, but that's not triggered by a find-bar replace either.
>
> Any suggestions on how I can track when a change is made via the find bar?


Most of the answers to text-view related issues are actually found in the class NSText, which it inherits. Specifically, NSText supports a delegate with the NSTextDelegate protocol, and that in turn defines:

-textDidChange:

which is a notification posted for every change no matter what.

--Graham



_______________________________________________

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: Tracking NSTextFinder changes
      • From: Shane Stanley <email@hidden>
References: 
 >Tracking NSTextFinder changes (From: Shane Stanley <email@hidden>)

  • Prev by Date: Tracking NSTextFinder changes
  • Next by Date: Re: Tracking NSTextFinder changes
  • Previous by thread: Tracking NSTextFinder changes
  • Next by thread: Re: Tracking NSTextFinder changes
  • Index(es):
    • Date
    • Thread