Re: Tracking NSTextFinder changes
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