(no subject)
(no subject)
- Subject: (no subject)
- From: Ian Gillespie <email@hidden>
- Date: Mon, 2 Jun 2003 18:53:35 -0700
Hi Carl,
I am currently trying to solve the same problem, but without much luck.
I hadn't thought of writing it to a temporary file. Interesting idea,
not very clean, but at least it works.
~Ian
The problem I'm having is in doing this in a sane way -
NSMutableAttributedString doesn't have a
replaceOccurrencesOfString:withString:options:range: method like
NSMutableString does, and I can't find a way to replace characters in
the string and maintain overall text attributes (bold in the right
spots, font size, etc).
So the current solution I have is to read the RTF file into an
NSMutableString, run through it doing all of my string substitutions,
and write it to a temporary file (in /tmp). Then I use NSTextView's
readRTFDFromFile: to get the string back in RTF format with all of the
attributes correct.
I'd like to have a better solution - anyone have any suggestions? I'd
be happy with just being able to rid myself of the temporary file
solution, but I'd rather there was a good way to go about it.
I'm sure this is one of those times when I've just blatantly missed the
appropriate tidbit in the documentation. The way I'm doing it is the
hard way, and if there's one thing that Cocoa has taught me it's that
it's not hard.
Thanks folks!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.