Re: NSFindAndReplace
Re: NSFindAndReplace
- Subject: Re: NSFindAndReplace
- From: Ali Ozer <email@hidden>
- Date: Tue, 27 Jun 2006 19:08:20 -0700
This method simply goes through NSTextStorage's
replaceCharactersInRange:withAttributedString:, which for a subclass
of NSTextStorage would go through NSTextStorage's primitives
(replaceCharactersInRange:withString: and setAttributes:range:). Your
subclass should be seeing multiple calls to these primitives, with
nothing private going on.
As you've observed, in some cases it does replace vast ranges. I don't
believe there are any bugs reported against it. If you are seeing
wrong calls, please submit a bug.
Of course please don't count on these behaviors, and in fact, the
implementation has changed significantly post-Tiger.
Ali
Begin forwarded message:
From: Todd Ransom <email@hidden>
Date: June 27, 2006 12:36:43 PM PDT
To: cocoa-dev <email@hidden>
Subject: NSFindAndReplace
I have a text storage subclass that takes an array of text storage
objects and makes them appear as a single text storage object. This
works very well for the most part, but I recently had a report from
a user that "Replace All" in the Find panel was hanging the app. So,
after a little digging, I found that the following method is not
working properly for my text storage:
[NSTextStorage(NSFindAndReplace)
replaceString:withString:ranges:options:inView:replacementRange:]
It is replacing vast sections of text (which may be an optimization)
and in some cases it is replacing the wrong sections of text.
I can't find any documentation on this method so I am wondering what
the best course of action is. Obviously I could override this method
to make it work, but since it is a private, undocumented method I am
hesitant to do that. Is there somewhere else in my text storage
class I should be looking to make this work properly
Todd Ransom
Return Self Software
http://returnself.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden