Is performFindPanelAction: working properly?
Is performFindPanelAction: working properly?
- Subject: Is performFindPanelAction: working properly?
- From: Jérome Laurens <email@hidden>
- Date: Mon, 12 Nov 2007 10:21:20 +0100
Hi,
I am currently using the find technology available in NSTextView.
I have my own custom text storage. With Leopard, I can find and
replace one by one but as soon as I try to replace many occurrences at
a time, thing get broken.
When replacing one occurrence at a time, some private NSTextFinder
sends my custom text storage a replaceCharactersInRange:withString:
message, everything is ok.
When replacing many occurrences at once, it appears that the changes
directly apply to the mutableString of my custom text storage,
but the standard text storage method never get called. In particular
my custom -edited:range:changeInLength: gets called when replacing one
occurrence but not when replacing all occurrences. So my custom text
storage never gets a chance to track any kind of change. Finally, it
falls into an inconsistent state and dies.
Investigating further might show that NSTextStorage private method
- (void)replaceString:(NSString *)old withString:(NSString *)new
ranges:(NSArray *)ranges options:(unsigned)options inView:(id)view
replacementRange:(NSRange)range;
does not take into account custom text storage.
I ended reimplementing the method above, but it is reall a pain.
_______________________________________________
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