Strategies for dynamic modification of search results in NSTextViews
Strategies for dynamic modification of search results in NSTextViews
- Subject: Strategies for dynamic modification of search results in NSTextViews
- From: Martin Hewitson <email@hidden>
- Date: Tue, 03 Jan 2012 12:05:47 +0100
Dear list,
I have an app which managed a bunch of files and presents these text files for viewing and editing in NSTextViews. I have implemented a project-wide search functionality which works fine, but with one problem. If the user changes the text in one file after making a search, then the search results are no longer valid. A typical use-case is to make a search for a word or phrase, then go through each result and modify it. Problem is, after the first modification by the user, the subsequent results are no longer accurate/valid.
Does anyone have any good suggestions as to how to update my search results when the underlying source text changes? Do I have to listen for all changes from the underlying text objects and try to adapt, or is there a better pattern for doing this? Xcode does this nicely: no matter what changes you make in the editor, the search results are updated on the fly.
Cheers,
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