• 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
Is performFindPanelAction: working properly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: How to implement an open dialog in a sheet and process its output?
  • Next by Date: Re: SMS PDU encoding
  • Previous by thread: Re: troubleshooting unrecognised selector messages
  • Next by thread: NSTextView CoreData binding and UndoManager
  • Index(es):
    • Date
    • Thread